iphone - Custom Toolbar in navigation control in ios doesnot show button text (add button + and edit button text in this case) -
//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;
you have bug in code.
either remove line or give other color.
toolbar.tintcolor=[uicolor clearcolor];
or change to
toolbar.tintcolor=[uicolor bluecolor];
that solves problem.
Comments
Post a Comment