Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在为 iOS 编写应用程序时,您可以UIButton通过编写简单地更改 a 的文本:
UIButton
variable.text = ("")
但是,使用 tvOS 你不能写.text,我想知道是否有人知道你怎么做。
.text
要更改 a 的文本/标题,UIButton您需要使用setTitle:forState:.
setTitle:forState:
目标 C:
[myButton setTitle:@"A New Title" forState:UIControlStateNormal];
迅速:
myButton.setTitle("A New Title", forState: .Normal)
UIButton 类参考