Add multiple buttons, and you can add just one
Uibarbuttonitem *anotherbutton = [[Uibarbuttonitem alloc] initwithtitle:nslocalizedstring (@ "register", nil) style: Uibarbuttonitemstyleplain target:self Action: @selector (Registerclick:)]; Uibarbuttonitem *anotherbutton2 = [[Uibarbuttonitem alloc] initwithtitle:nslocalizedstring (@ "login", nil) style: Uibarbuttonitemstyleplain target:self Action: @selector (Loginclick:)]; [Self.navigationitem Setrightbarbuttonitems:[nsarray Arraywithobjects:anotherbutton,anotherbutton2,nil];
Add logo, only on the first page, use the following method
Self.sharenavleftview = [[UIView alloc] init]; Self.shareNavleftView.frame = CGRectMake (0.0, 0.0, 191.0, 47.0); Uiimageview *img = [[Uiimageview alloc] init]; Img.image = [UIImage imagenamed:@ "Oatoslogo.png"]; Img.autoresizingmask = Uiviewautoresizingflexiblewidth; Img.frame = Self.shareNavleftView.frame; [Self.sharenavleftview addsubview:img]; Self.navigationItem.leftBarButtonItem = [[Uibarbuttonitem alloc] initWithCustomView:self.shareNavleftView];
In this way, the logo will be added to each of the following pages, do not meet my needs
[Self.navigationController.view AddSubview:self.shareNavleftView];
iOS development: Add multiple buttons to the navigation bar and add logos to the left