开发者

how can i set differnt font on UIButton Dynamically?

I want to set custom font for b开发者_开发百科utton title dynamically so how can i set it.


UIButton *button        = [UIButton buttonWithType: UIButtonTypeRoundedRect];
button.titleLabel.font  = [UIFont fontWithName:@"font name" size:12];


[tmp setFont:[UIFont fontWithName:@"American Typewriter" size:18]];

the font name take it from an array and keep changing the index.

So it will look like

[tmp setFont:[UIFont fontWithName:[fontArray objectAtIndex:desiredIndex] size:18]];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜