i had application in creating toolbar navigate through web view .everything working fine,except color of button.when not enabling button showing same color tint color of toolbar.and when enable it showing white.but need present button is.here how doing ,`
[self.navigationcontroller settoolbarhidden:no animated:yes]; self.navigationcontroller.toolbar.barstyle = uibarstyleblacktranslucent; self.navigationcontroller.toolbar.tintcolor=[uicolor colorwithred:215/255.0 green:215/255.0 blue:215/255.0 alpha:1.0]; buttongoback = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"back_icon.png"] style:uibarbuttonitemstyleplain target:self action:@selector(backbuttontouchup:)]; uibarbuttonitem *fixedspace = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemfixedspace target:nil action:nil]; fixedspace.width = 30; buttongoforward = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"forward_icon.png"] style:uibarbuttonitemstyleplain target:self action:@selector(forwardbuttontouchup:)]; uibarbuttonitem *flexiblespace = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:nil action:nil]; buttonaction = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemaction target:self action:@selector(buttonactiontouchup:)]; uibarbuttonitem *buttoncontainer = [[uibarbuttonitem alloc] initwithcustomview:containerview]; [containerview release]; nsmutablearray *toolbarbuttons = [[nsmutablearray alloc] init]; [toolbarbuttons addobject:buttongoback]; [toolbarbuttons addobject:fixedspace]; [toolbarbuttons addobject:buttongoforward]; [toolbarbuttons addobject:flexiblespace]; [toolbarbuttons addobject:buttoncontainer]; [toolbarbuttons addobject:flexiblespace]; [toolbarbuttons addobject:buttonaction]; // set buttons tool bar [self.navigationcontroller.toolbar setitems:toolbarbuttons animated:yes];
`
how can orginal color of button button enabled=no;can me
i had made out solution ,happy share if facing same problem.
[[uibarbuttonitem appearance] settintcolor:[uicolor redcolor]];
in way can give color barbuttons.
Comments
Post a Comment