//parent view of two buttonsUIView *rightbuttonview = [[UIView alloc] Initwithframe:cgrectmake (0,0, -, -)];//History Browse ButtonUIButton *historybtn = [[UIButton alloc] Initwithframe:cgrectmake (0,0, -, -)]; [Rightbuttonview ADDSUBVIEW:HISTORYBTN]; [Historybtn setimage:[uiimage imagenamed:@"button_history"] Forstate:uicontrolstatenormal]; [Historybtn addtarget:self Action: @selector (Historybtnevent) forcontrolevents:uicontroleventtouchupinside]; //Home Search ButtonUIButton *mainandsearchbtn = [[UIButton alloc] Initwithframe:cgrectmake ( -,0, -, -)]; [Rightbuttonview ADDSUBVIEW:MAINANDSEARCHBTN]; [Mainandsearchbtn setimage:[uiimage imagenamed:@"button_filter-"] Forstate:uicontrolstatenormal]; [Mainandsearchbtn addtarget:self Action: @selector (mainandsearchbtnevent) forControlEvents: UIControlEventTouchUpInside]; //Add the two buttons on the right to the RightbarbuttonitemUibarbuttonitem *rightcunstombuttonview =[[Uibarbuttonitem alloc] initwithcustomview:rightbuttonview]; Self.navigationItem.rightBarButtonItem= Rightcunstombuttonview;
IOS Custom Navigationbar right button Rightbarbuttonitem--button