iOS: Add multiple buttons to the navigation and join the left logo

Source: Internet
Author: User

Adding multiple buttons can also add only 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 display, 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];

Use the following method. The logo will be added to each of the following pages. Doesn't fit my needs.

[Self.navigationController.view AddSubview:self.shareNavleftView];

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

iOS: Add multiple buttons to the navigation and join the left logo

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.