Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ios中导航控件中的自定义工具栏不显示按钮文本(在本例中,添加按钮和编辑按钮文本)_Ios_Iphone - Fatal编程技术网

ios中导航控件中的自定义工具栏不显示按钮文本(在本例中,添加按钮和编辑按钮文本)

ios中导航控件中的自定义工具栏不显示按钮文本(在本例中,添加按钮和编辑按钮文本),ios,iphone,Ios,Iphone,您的代码中有bug 要么删除这条线,要么给它一些其他颜色 UIToolbar *toolBar=[[UIToolbar alloc] initWithFrame:CGRectMake(160.0,20, 150, 30)]; toolBar.barStyle= style toolBar.tintColor=[UIColor clearColor]; toolBar.backgroundColor=[UIColor clearColor]; NSArray *items=[NSArr

您的代码中有bug

要么删除这条线,要么给它一些其他颜色


 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;
或者改成

toolBar.tintColor=[UIColor clearColor];

这就解决了你的问题。

非常感谢。它很有效。看起来你忘记投票了。谢谢。:-)投赞成票需要15个声誉先生我刚开始做这个
toolBar.tintColor=[UIColor clearColor];
toolBar.tintColor=[UIColor blueColor];