objective c - Remove leftBarButtonItem Background -
how remove leftbarbuttonitem blue background? tried style:uibarbuttonitemstyleplain
had no result.
code:
self.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"icon_home"] style:uibarbuttonitemstyleplain target:self.navigationcontroller action:@selector(openmenu) ];
uibutton *tempbutton = [uibutton buttonwithtype:uibuttontypecustom]; [tempbutton setframe:cgrectmake(2, 1, 34, 34)]; // home button image width , height. [tempbutton addtarget:self action:@selector(btnbackclicked:) forcontrolevents:uicontroleventtouchupinside]; [tempbutton setimage:[uiimage imagenamed:@"icon_home.png"] forstate:uicontrolstatenormal]; [tempbutton setimage:[uiimage imagenamed:@"icon_home_h.png"] forstate:uicontrolstatehighlighted]; [self.navigationitem setleftbarbuttonitem:[[uibarbuttonitem alloc] initwithcustomview:tempbutton]];
Comments
Post a Comment