Hi i have problem with titleLabel property. When I want to change it. The changes don’t apear.
This is my code:
UIButton *menuItemButton = [[UIButton alloc] initWithFrame:CGRectMake(x, y, 290.0, 35.0)];
[menuItemButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[menuItemButton setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
menuItemButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[menuItemButton setContentEdgeInsets:UIEdgeInsetsMake(0, 11.0, 0, 0)];
[menuItemButton setTitle:(NSString *)[itemParams objectForKey:@"Name"] forState:UIControlStateNormal];
[menuItemButton setBackgroundImage:menuItemImage forState:UIControlStateNormal];
[menuItemButton setTag:idx];
[[menuItemButton titleLabel] setFont:[UIFont fontWithName:@"Vardana" size:5]];
[menuItemButton addTarget:self action:@selector(menuItemClicked:) forControlEvents:UIControlEventTouchUpInside];
And this is not working:
[[menuItemButton titleLabel] setFont:[UIFont fontWithName:@"Vardana" size:15]];
I’m also try:
[menuItemButton.titleLabel setFont:[UIFont fontWithName:@"Vardana" size:15]];
menuItemButton.titleLabel.font = [UIFont fontWithName:@"Vardana" size:15];
Other properties of titleLabel also not work for ex. alignment and color.
All thigs I’m write in viewDidLoad after [super viewDidLoad];
I think the correct name for the font is
Verdanainstead ofVardana. You can check the names of several fonts in http://iphonedevsdk.com/forum/iphone-sdk-development/6000-list-of-uifonts-available.html