iOS 开发怎样在导航条上添加多个item

//为导航栏添加右侧按钮1
UIBarButtonItem *right1 = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"more"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(rightAction:)];

//为导航栏添加右侧按钮2
UIBarButtonItem *right2 = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"more"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(rightAction:)];
 
NSArray *arr = [[NSArrayalloc]initWithObjects:right1, right2, nil];

self.navigationItem.rightBarButtonItems = arr;

你可能感兴趣的:(iOS 开发怎样在导航条上添加多个item)