1

i´m developing an iOS-Application with VisualStudio/Xamarin. I have to set the transparency on the navigationbar to 100%. But let me explain the whole thing:

On the first view the navigationbar have a background image set by this code:

var navigationImage = UIImage.FromFile("gradient.jpg");
UINavigationBar.Appearance.SetBackgroundImage(navigationImage, UIBarMetrics.Default);

The first view got several tablecell items, if clicked, a detail view shows up. On that detail view the navigationbar should be completely transparent! Only the back button and a title should be leftover.

I tried everything from translucent = yes to this solution which i also found here on stackoverflow.

I also tried to set a color to the first navigationbar and then change it on the next view to another color which works, but if i get back to the firstview the navigationbar color stays the same, even if i override the ViewWillAppear-method from the first view where the BarTintColor is set.

Thanks for your help!

greetings

Community
  • 1
  • 1

1 Answers1

2

Well, for what it's worth, I actually followed your solution link and translated it to Xamarin. If I put the following code in ViewDidLoad on my VC, the Navigation Bar is completely transparant ;)

this.NavigationController.NavigationBar.SetBackgroundImage (new UIImage (), UIBarMetrics.Default);
this.NavigationController.View.BackgroundColor = UIColor.Clear;
this.NavigationController.NavigationBar.BackgroundColor = UIColor.Clear;
this.NavigationController.NavigationBar.ShadowImage = new UIImage ();
Lewion
  • 235
  • 1
  • 3
  • 17