我有一个带有左右按钮的导航栏,我需要在右侧按钮旁边放另一个按钮。有谁知道我该怎么做?这里有一些代码可以提供帮助:
- (id)init {
self = [super initWithStyle:UITableViewStyleGrouped];
if (self) {
_pinArray = [[NSArray alloc]init];
_pinArray = [Data singleton].annotations;
UIBarButtonItem *right = [[UIBarButtonItem alloc]initWithTitle:@"Map"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goToMap:)];
self.navigationItem.rightBarButtonItem = right;
UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithTitle:@"Menu"
style:UIBarButtonItemStylePlain
target:self
action:@selector(goToMenu:)];
self.navigationItem.leftBarButtonItem = left;
self.navigationItem.title = @"My Homes";
}
return self;
}