2016-01-20 20 views
1

如何创建具有导航栏(透明)并且此视图位于导航栏后面的视图(自动布局)。请查看图片在透明背后创建自动布局视图NavigationBar

enter image description here

我试图在viewDidLoad中

NavigationController.NavigationBar.Translucent = true; 
EdgesForExtendedLayout = UIRectEdge.None; 

是C#代码(Xamarin项目).. 的IO相当于

self.edgesForExtendedLayout = UIRectEdgeNone; 
navigationBar.translucent = NO; 
+0

是什么问题?你试过了什么? –

回答

2

它的工作原理,当u盘的根UINavigationController的性质(例如,在AppDelegate中)

navigationController.NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); 
navigationController.NavigationBar.ShadowImage = new UIImage(); 
navigationController.NavigationBar.Translucent = true;