iOS development: Add multiple buttons to the navigation bar and add logos to the left

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.