我现在正在制作一个应用程序的原型。我以编程方式向导航栏添加了一堆栏按钮:
NSArray *buttonTitles = [[NSArray alloc] initWithObjects:@"Alerts", @"Causes", @"Msgs", @"My Work", @"My Posts", nil];
NSMutableArray *rightBarButtons = [[NSMutableArray alloc] init];
for (int i = 0; i < 5; i++)
{
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
rightButton.frame = CGRectMake(0, 0, 44, 34);
[rightButton setTitle:[buttonTitles objectAtIndex:i] forState:UIControlStateNormal];
[rightButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
rightButton.titleLabel.font = [UIFont systemFontOfSize:10];
rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
[rightBarButtons addObject:rightItem];
}
现在,它们看起来真的很难看,尤其是在导航栏上。我想拍摄一些图像(类似于标签栏图像)并将它们放在那里以替换按钮。我该怎么做?
对不起我的愚蠢,我是新手。
谢谢!