Reputation: 7501
I want to set custom font for button title dynamically so how can i set it.
Upvotes: 3
Views: 8333
Reputation: 14568
[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]];
Upvotes: 0
Reputation: 3614
UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect];
button.titleLabel.font = [UIFont fontWithName:@"font name" size:12];
Upvotes: 21