重疊海誓山盟的意見我想在Xamarin工作室爲iPhone做一個MVC應用程序。我有一個NavigationBar
,我添加了一個NavigationItemSetLeftBarButtonItem()
,它切換Flyout Navigation組件的邊欄。工作得很好,除了這個,見下圖:在Xamarin.iOS
正如你所看到的,「側邊欄」會在導航欄下方。我怎麼能推下來,這樣它看起來像這個例子形象:
重疊海誓山盟的意見我想在Xamarin工作室爲iPhone做一個MVC應用程序。我有一個NavigationBar
,我添加了一個NavigationItemSetLeftBarButtonItem()
,它切換Flyout Navigation組件的邊欄。工作得很好,除了這個,見下圖:在Xamarin.iOS
正如你所看到的,「側邊欄」會在導航欄下方。我怎麼能推下來,這樣它看起來像這個例子形象:
您應該設置上邊距爲您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);
沒有看到源你如何構建你的觀點很難說。但我的猜測是你將所有的東西嵌套在一個UINavigationController中,這很可能不是你想要的。它以這種方式出現,因爲你的內容被移出,而導航欄沒有。你應該做的是...
window.RootViewController = flyout;
flyout.ViewControllers = new []{
new UINavigationController(vc1),
new UINavigationController(vc2),
new UINavigationController(vc3),
};
嘗試將NavigationController.NavigationBar的Translucent-Property設置爲false。 這應該可以解決問題。
根本沒有差別,很奇怪。 – Jack
爲什麼您的代碼段不像@choper那樣行事? – Jack
看着'FlyoutNavigation'的魅力,在'ViewWillAppear'上他們重置位置爲零,所以我唯一可以提供的建議是從github下載源代碼 - https://github.com/Clancey/ FlyoutNavigation - 並進行所需的更改(實際上是上邊距) – choper