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.
在我的故事板中,我有一个带有按钮的表格视图。我想为按钮自定义分配 float 和 int 值。
我已经分配了一个标签,players.text= Player.player; 但我不知道为按钮分配 float 或 int 值。
players.text= Player.player;
这是如何设置按钮title,
title
对于 int 值:
[button setTitle:[NSString stringWithFormat:@"%i", intValue] forState:UIControlStateNormal];
对于浮点值:
[button setTitle:[NSString stringWithFormat:@"%0.1f", floatValue] forState:UIControlStateNormal];