//Adding Right Bar Add Button
UIBarButtonItem *addBarButton=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertData)];
//self.navigationItem.rightBarButtonItem=addBarButton;
UIToolbar *toolBar=[[UIToolbar alloc] initWithFrame:CGRectMake(160.0,20, 150, 30)];
toolBar.barStyle= style
toolBar.tintColor=[UIColor clearColor];
toolBar.backgroundColor=[UIColor clearColor];
NSArray *items=[NSArray arrayWithObjects:addBarButton,self.editButtonItem,nil];
[toolBar setItems:items];
UIBarButtonItem *barItem=[[UIBarButtonItem alloc]
self.navigationItem.rightBarButtonItem=barItem;
self.navigationController.toolbarHidden=YES;
答案 0 :(得分:0)
您的代码中存在错误。
删除此行或给它一些其他颜色。
toolBar.tintColor=[UIColor clearColor];
或将其更改为
toolBar.tintColor=[UIColor blueColor];
这解决了你的问题。