gpt4 book ai didi

ios - UITableViewRowAction 在 Swift 中自定义标题字体大小

转载 作者:行者123 更新时间:2023-11-30 13:25:51 25 4
gpt4 key购买 nike

我的 tableViewCell 中有一个编辑和删除 tableViewRowAction。目前我正在使用内置表情符号作为我的标题,但它太小了。如何将字体变大?

我知道我们只能在tableViewRowAction中自定义有限的东西。但有没有办法解决这个问题,让标题字体变大?

我检查了其他线程,其中大多数都使用了:

UIButton.appearance().setAttributedTitle(NSAttributedString(string: "Your Button", attributes: attributes), forState: .Normal)

当然有一个确定字体大小的设置属性。但是,这会影响所有按钮,这不好。

非常感谢任何帮助!谢谢!

最佳答案

您将其设置为 UIButton,以便为所有 UIButton 对象设置它。

您可以为特定的按钮对象设置它,例如,

  let myButton: UIButton = UIButton()  //your button here
let attributedStr: NSAttributedString = NSAttributedString()
myButton.setAttributedTitle(attributedStr, forState: .Normal)

更新:

您可以将标题设置为属性字符串。

检查Apple documentation 为此,请参阅 this answer了解更多详情

希望这会有所帮助:)

关于ios - UITableViewRowAction 在 Swift 中自定义标题字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37201366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com