IOS custom navigation bar title and return button title

Source: Internet
Author: User

custom navigation bar title in iOS:
UILabel *titletext = [[UILabel alloc] Initwithframe:cgrectmake (0  = [Uicolor clearcolor]; Titletext.textcolor=[Uicolor Whitecolor]; [TitleText setfont:[uifont systemfontofsize:17.0]]; [TitleText SetText: @" XXX " ]; Self.navigationItem.titleView=titletext; [TitleText release];

Customize navigation bar Back button in iOS: (Before Pushviewcontroller)
Uibarbuttonitem *backitem=[[Uibarbuttonitem alloc]init];  Backitem.title=@ " back ";  Backitem.tintcolor=[uicolor colorwithred:129/255.0 Green:129/255.0  Blue:129/255.0 Alpha:1.0];   = Backitem;  [Backitem release];

Custom navigation bar Right button in iOS:
Uibarbuttonitem * Rightbutton =[[Uibarbuttonitem alloc] Initwithtitle:@"Back to Home"style:uibarbuttonitemstylebordered Target:self Action: @selector (Callmodallist)]; Rightbutton.image=[uiimage imagenamed:@"Right_button.png"];rightbutton.tintcolor=[uicolor colorwithred: About/255.0Green About/255.0Blue About/255.0Alpha1.0];self.navigationitem.rightbarbuttonitem=Rightbutton; [Rightbutton release];

Or

    //Set Back buttonUIButton* Backbutton =[UIButton Buttonwithtype:uibuttontypecustom]; [Backbutton setbackgroundimage:[uiimage imagenamed:@"Btn_public_back"] Forstate:uicontrolstatenormal]; Backbutton.frame= CGRectMake (0,0, *, *);    [Backbutton addtarget:self Action: @selector (Backaction) forcontrolevents:uicontroleventtouchupinside]; Leftbaritem=[[Uibarbuttonitem alloc] Initwithcustomview:backbutton]; Self.navigationItem.leftBarButtonItem= Leftbaritem;

IOS custom navigation bar title and return button title

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.