iOS system Navigationbar background color, text color processing

Source: Internet
Author: User

- (void) setrightbarbuttonitem{//Create Done ButtonUibarbuttonitem *donebutton = [[Uibarbuttonitem alloc]initwithtitle:[nsstring stringWithFormat:@"OK (%lu/%lu)", (unsignedLong) Self.selectedAssetURLs.count, (unsignedLong) Self.maximumnumberofselection] Style:uibarbuttonitemstyleplain target:self action: @selector (done:)];    [Self.navigationitem Setrightbarbuttonitem:donebutton Animated:yes]; Uicolor*color = [Uicolor colorwithhexstring:@"#fe5346"]; CGRect Frame= CGRectMake (0,0, Screen_width, -); UIImage*image =[UIImage Imagewithcolor:color withframe:frame];    [Self.navigationController.navigationBar setbackgroundimage:image Forbarmetrics:uibarmetricsdefault]; Self.navigationController.navigationBar.tintColor=[Uicolor Whitecolor]; Self.navigationController.navigationBar.barTintColor=[Uicolor Whitecolor]; Self.navigationController.navigationBar.titleTextAttributes=@{nsforegroundcolorattributename: [Uicolor Whitecolor]}; }- (void) Navigationcontroller: (Uinavigationcontroller *) Navigationcontroller Willshowviewcontroller: (UIViewController *) Viewcontroller animated: (BOOL) animated{/** * @author songxing, 15-07-30 14:07:45 * * Uiimagepickercontroller Color correction **/    if([Navigationcontroller Iskindofclass:[uiimagepickercontrollerclass]] &&((Uiimagepickercontroller*) navigationcontroller). SourceType = =uiimagepickercontrollersourcetypephotolibrary)        {[[UIApplication sharedapplication] setstatusbarhidden:no];    [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent Animated:NO]; }        if(NavigationController.viewControllers.count! =3)return; CGFloat screenheight=[[UIScreen mainscreen] bounds].size.height; UIView*plcropoverlay = [viewcontroller.view.subviews[1] Subviews][0]; Plcropoverlay.hidden=YES; intPosition =0; Position= (ScreenHeight = =568) ?124: the; Cashapelayer*circlelayer =[Cashapelayer layer]; Uibezierpath*path2 =[Uibezierpath Bezierpathwithovalinrect:cgrectmake (0.0f, Position, Screen_width,320.0f)];        [Path2 Setusesevenoddfillrule:yes];        [Circlelayer setpath:[path2 Cgpath];    [Circlelayer Setfillcolor:[[uicolor Clearcolor] cgcolor]; Uibezierpath*path = [Uibezierpath bezierpathwithroundedrect:cgrectmake (0,0, Screen_width, screenheight- the) Cornerradius:0];    [Path appendpath:path2];        [Path Setusesevenoddfillrule:yes]; Cashapelayer*filllayer =[Cashapelayer layer]; Filllayer.path=path.    Cgpath; Filllayer.fillrule=kcafillruleevenodd; Filllayer.fillcolor=[Uicolor Clearcolor].    Cgcolor; Filllayer.opacity=0.8;        [ViewController.view.layer Addsublayer:filllayer]; }

iOS system Navigationbar background color, text color processing

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.