Because iOS7 after leftbarbuttonitem to the right shifted about 10px, now to make Leftbaritem and iOS7 before the display, processing as follows:
if(isBeforeIOS7) {UIButton*BTN =[UIButton Buttonwithtype:uibuttontypecustom]; Btn.frame= CGRectMake ( the,5, A, A); [Btn setbackgroundimage:[uiimage imagenamed:@"Icon_back_left"] Forstate:uicontrolstatenormal]; [Btn addtarget:self Action: @selector (Gobackaction) forcontrolevents:uicontroleventtouchupinside]; Uibarbuttonitem*backbarbtn=[[Uibarbuttonitem alloc]initwithcustomview:btn]; Self.navigationItem.leftBarButtonItem=backbarbtn; } Else{Uibarbuttonitem*BACKBARBTN = [[Uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"Icon_back_left"] Style:uibarbuttonitemstyledone target:self action: @selector (gobackaction)]; Uibarbuttonitem*negativespacer =[[Uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemfixedspace target:nil Action:nil]; Negativespacer.width= -Ten; Self.navigationItem.leftBarButtonItems=@[negativespacer,backbarbtn]; }
IOS7 dealing with Leftbarbuttonitem problems later