ios - UINavigationBarItem custom - how to get the corner of tabcontroller? -
i want ask how can icon of navigationtabbaritem left corner (left:0) , right corner (right:0).
my code :
_custombtn = [[uibutton alloc] initwithframe:cgrectmake(0, 0, 44, 44)]; _custombtn.backgroundcolor = [uicolor redcolor]; [_custombtn setbackgroundimage:[uiimage imagenamed:@"ic_msg.png"]forstate:uicontrolstatenormal]; [_custombtn addtarget:self action:@selector(viewbn:) forcontrolevents:uicontroleventtouchupinside]; self.csbtn = [[uibarbuttonitem alloc]initwithcustomview:_custombtn];
uibutton *abutton = [uibutton buttonwithtype:uibuttontyperoundedrect]; abutton.frame = cgrectmake(0.0, 0.0, 44, 44); uibarbuttonitem *abarbuttonitem = [[uibarbuttonitem alloc] initwithcustomview:abutton]; [abutton addtarget:self action:@selector(rightbarbuttonaction:) forcontrolevents:uicontroleventtouchupinside]; uibarbuttonitem *spacefix = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemfixedspace target:nil action:null]; spacefix.width = -10; self.navigationitem.rightbarbuttonitems = @[spacefix, abarbuttonitem];
please add spacefix
resolve problem may lot