[英]Views overlapping eachother in Xamarin.iOS
I'm trying to make a MVC application in Xamarin Studio for iPhone. 我正在尝试在Xamarin Studio for iPhone中制作MVC应用程序。 I have a
NavigationBar
and I've added a NavigationItemSetLeftBarButtonItem()
which toggles the sidebar from the Flyout Navigation component. 我有一个
NavigationBar
并添加了NavigationItemSetLeftBarButtonItem()
,它可以从弹出导航组件中切换边栏。 Works pretty well except for this, see image below: 除此之外效果很好,请参见下图:
As you can see, the "sidebar" is going beneath the NavigationBar. 如您所见,“侧边栏”位于NavigationBar下方。 How can I push it down so that it looks like this example image:
我如何向下推,使其看起来像下面的示例图像:
You should set top margin for you NavigationTableView
, so: 您应该为
NavigationTableView
设置上边距,因此:
var navigation = new FlyoutNavigationController(); //the place where you init your side menu
navigation.NavigationTableView.Frame = new RectangleF(
navigation.NavigationTableView.Frame.X,
65,
navigation.NavigationTableView.Frame.Width,
navigation.NavigationTableView.Frame.Height - 65);
Without seeing the source of how you constructed your views its hard to tell. 没有看到如何构造视图的源就很难说出来。 But my guess would be you have everything nested in a UINavigationController which most likely isn't what you want.
但是我的猜测是,您将所有内容嵌套在UINavigationController中,这很可能不是您想要的。 It appears this way because your content is moved out and the nav bar has not.
出现这种情况是因为您的内容已移出,而导航栏没有。 What you should do is...
你应该做的是...
window.RootViewController = flyout;
flyout.ViewControllers = new []{
new UINavigationController(vc1),
new UINavigationController(vc2),
new UINavigationController(vc3),
}; };
try setting the Translucent-Property of the NavigationController.NavigationBar to false. 尝试将NavigationController.NavigationBar的Translucent-Property设置为false。 This should solve the problem.
这应该可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.