Ich habe viele der Antworten in ähnlichen Fragen versucht, aber keine von ihnen hat für mich gearbeitet. Ich versuche, den Schatten der Navigationsleiste 1px zu entfernen, aber alles, was ich versuchte, endet, die Stabfarbe zu entfernen und es weiß/etwas helle Farbe zu machen. (? Innerhalb App Delegate) Jede Idee, wie es zu entfernenSchattenlinie unterhalb der Navigationsleiste entfernen, ohne Balkenfarbe zu entfernen?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let redPart: CGFloat = CGFloat(65)/255
let greenPart: CGFloat = CGFloat(107)/255
let bluePart: CGFloat = CGFloat(166)/255
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
UINavigationBar.appearance().barTintColor = UIColor(red: redPart, green: greenPart, blue: bluePart, alpha: 1.0)
//Set the colors for bar button items and text
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.whiteColor(), NSFontAttributeName: UIFont(name: "HelveticaNeue-Light", size: 22)!]
// Override point for customization after application launch.
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.checkForReachability(_:)), name: kReachabilityChangedNotification, object: nil);
self.reachability = Reachability.reachabilityForInternetConnection();
self.reachability!.startNotifier()
return true
}
Oben ist mein Code, und das ist, was ich versucht habe:
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
Aber jedes Mal, egal welche Linie es ist auf beginnt die Bar wie diese anstelle der blauen Farbe sehen ich es ...
Mögliche Duplizierung: http : //stackoverflow.com/questions/32208378/how-to-remove-the-shadow-line-from-a-navigation-bar? rq = 1 Allerdings ist es möglich, überprüfen Sie, wie Chameleon dies tat: https://github.com/ViccAlexander/Chameleon/blob/master/Pod/Classes/Objective-C/UINavigationController%2BChameleon.m oder https: // githu b.com/samwize/UINavigationBar-Addition/ – Grubas
Mögliches Duplikat von [So blenden Sie iOS7 UINavigationBar 1px unterste Zeile] (http://stackoverflow.com/questions/19226965/how-to-hide-ios7-uinavigationbar-1px-bottom -line) – jjatie