Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make navigation bar transparent regarding below image in iOS 8.1

Tags:

swift

ipad

ios8.1

I try to set my navigation bar transparent regarding a image below this, something like the following image :

enter image description here

I tried the solution in transparent navigation bar ios but I don't get the above result, I get only the icon on the left but without any color in the navigation bar, completely transparent. But if I set a background color the transparency disappears at all.

There is any way to set a color in the navigation bar and make it transparent??

Thanks in advance.

like image 681
Victor Sigler Avatar asked Dec 30 '14 16:12

Victor Sigler


People also ask

How do I change the navigation bar on my Iphone?

A user changes the navigation bar's style, or UIBarStyle , by tapping the “Style” button to the left of the main page. This button opens an action sheet where users can change the background's appearance to default, black-opaque, or black- translucent.


1 Answers

just checked on the 8.1 simulator and got very similar result to your picture

    let bar:UINavigationBar! =  self.navigationController?.navigationBar

    bar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
    bar.shadowImage = UIImage()
    bar.backgroundColor = UIColor(red: 0.0, green: 0.3, blue: 0.5, alpha: 0.3)

main point here is background color with alpha.

Check attached image, maybe I missed something?

enter image description here

like image 56
sage444 Avatar answered Oct 11 '22 16:10

sage444