- (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