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]];
精彩评论