Uitoolbar in iOS

Source: Internet
Author: User

#import"RootViewController.h"@interface Rootviewcontroller () @end @implementation Rootviewcontroller- (void) viewdidload {[Super viewdidload]; //Show Toolbar//Self.navigationController.toolbarHidden = NO; //animation effects[Self.navigationcontroller settoolbarhidden:no Animated:yes]; //Background ColorSelf.navigationController.toolbar.barTintColor =[Uicolor Redcolor]; //Render ColorSelf.navigationController.toolbar.tintColor =[Uicolor Orangecolor]; //set a background picture[Self.navigationController.toolbar setbackgroundimage:[uiimage imagenamed:@"123.jpg"] Fortoolbarposition:uibarpositionbottom Barmetrics:uibarmetricsdefault]; Uibarbuttonitem*item1 =[[Uibarbuttonitem alloc] Initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action: @selector (                Handle:)]; Uibarbuttonitem*ITEM2 = [[Uibarbuttonitem alloc] Initwithtitle:@"Save"Style:uibarbuttonitemstyleplain target:self Action: @selector (handle:)]; Uibarbuttonitem*ITEM3 = [[Uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"234.jpg"] Style:uibarbuttonitemstyleplain target:self action: @selector (handle:)]; Uibarbuttonitem*ITEM4 =[[Uibarbuttonitem alloc] Initwithbarbuttonsystemitem:uibarbuttonsystemitemflexiblespace target:self action:@    Selector (handle:)]; //Uibarbuttonitem *item4 = []Self.toolbaritems =@[item1,item4,item2,item4,item3,item4]; //Uitoolbar *toolbar = [[Uitoolbar alloc] Initwithframe:cgrectmake ( +, +, +)];//[Self.view Addsubview:toolbar];//Toolbar.backgroundcolor = [Uicolor redcolor];//toolbar.items = @[item1,item2];    }- (void) Handle: (Uibarbuttonitem *) item{NSLog (@"Gogogogo");} @end

Uitoolbar in iOS

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.