简体   繁体   English

添加第二个时,第一个UIBarButton消失

[英]First UIBarButton disappears when second one is added

I am working on ios Bar Button icon where I have to display UIsegmented control with two UIBarButton icon on the right site but when I try to add second button using interface builder the first added button get disappears 我正在使用ios Bar Button图标,我必须在正确的站点上显示带有两个UIBarButton图标的UIsegmented控件,但是当我尝试使用界面构建器添加第二个按钮时,第一个添加的按钮消失了

This is how the view is added: View->Navigation Bar->Navigation Item-> BarButton Item-> Button 这是添加视图的方式:视图->导航栏->导航项-> BarButton项->按钮

Can anyone help me to find the possible solution 谁能帮我找到可能的解决方案

UIBarButtonItem *item1=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(firstSelector)];

UIBarButtonItem *item2=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(secondSelector)];

NSArray *items=[[NSArray alloc]initWithObjects:item1,item2, nil];
self.navigationItem.rightBarButtonItems=items;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM