2

テキストの設定方法UIButton

topYellowButton2 = [UIButton buttonWithType:UIButtonTypeCustom];
topYellowButton2.frame = CGRectMake(80, 0, 90, 20);

[topYellowButton2 setTitleColor:[UIColor colorWithRed:0.0 green:0.6 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
4

4 に答える 4

2

これを試して

topYellowButton2=[UIButton buttonWithType:UIButtonTypeCustom]; 
topYellowButton2.frame=CGRectMake(80, 0, 90, 20);
[topYellowButton2 setTitle:@"Your Title" forState:UIControlStateNormal];
于 2012-07-18T07:28:35.113 に答える
1

ノーマルとハイライトの両方にタイトルを設定

[topYellowButton2 setTitle:@"Button Title" forControlState:UIControlStateNormal];
[topYellowButton2 setTitle:@"Button Title" forControlState:UIControlStateHighlighted];
于 2012-07-18T07:30:03.480 に答える
0

次の行を追加するだけです。

[topYellowButton2 setTitle:@"my button" forState:UIControlStateNormal];
于 2012-07-18T07:28:09.660 に答える
0
[topYellowButton2 setTitle:@"My Title" forState:UIControlStateNormal];
于 2012-07-18T07:26:36.027 に答える