1 //Remove the split line below the navigation bar2 if([Self.navigationController.navigationBar respondstoselector: @selector (setbackgroundimage:forbarmetrics:)]) {3Nsarray *list=self.navigationController.navigationBar.subviews;4 for(IDObjinchlist) {5 if([obj Iskindofclass:[uiimageviewclass]]) {6Uiimageview *imageview= (Uiimageview *) obj;7Nsarray *list2=imageview.subviews;8 for(IDObj2inchList2) {9 if([Obj2 Iskindofclass:[uiimageviewclass]]) {TenUiimageview *imageview2= (Uiimageview *) Obj2; Oneimageview2.hidden=YES; A } - } - } the } - } - - + -Self.automaticallyadjustsscrollviewinsets =NO; +Self.edgesforextendedlayout = Uirectedgetop;//Top Start ASelf.navigationController.navigationBar.translucent = YES;//Navigation bar Transparency at[Self.navigationController.navigationBar setbackgroundimage:[uiimage imagenamed:@"Barpic1"] Forbarmetrics:uibarmetricsdefault];//Add background color (picture) (main if you want to set the navigation bar to transparent) • Just use a transparent picture.) - //set the navigation bar text to white -self.navigationcontroller.navigationbar.titletextattributes=[nsdictionary Dictionarywithobjectsandkeys:[uicolor whitecolor],uitextattributetextcolor, nil]; - //set back button to white - [Self.navigationController.navigationBar settintcolor:[uicolor whitecolor]; - //Set Back button unity to return inUibarbuttonitem *item = [[Uibarbuttonitem alloc] Initwithtitle:@"return"style:uibarbuttonitemstyleplain Target:nil Action:nil]; -Self.navigationItem.backBarButtonItem = Item;
Remove the navigation bar split line and set the background color of the navigation bar