需要有關 Xamarin Forms IOS 的幫助(Android 作業正常)。當我在選項卡式專案上打開一個新頁面時,IOS上的navbar出現INVISIBLE,但是當上下滾動頁面時,Navbar出現,雖然不可見,但回傳按鈕在那里,可以點擊。專案的所有其他頁面都具有相同的行為,后退按鈕在那里,但不可見。見下圖。如何設定導航欄對所有頁面可見?
在此處查看 GIF:

uj5u.com熱心網友回復:
這是IOS15默認行為的改變,來解決我們只需要修改的問題scrollEdgeAppearance的性質UINavigationBarAppearance 。
將以下代碼放入AppDelegate.cs或SceneDelegate.cs在 iOS 專案中。
UINavigationBarAppearance a = new UINavigationBarAppearance();
a.ConfigureWithTransparentBackground();
a.BackgroundColor = UIColor.Blue;
a.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White};
UINavigationBar.Appearance.StandardAppearance = a;
UINavigationBar.Appearance.CompactAppearance = a;
UINavigationBar.Appearance.ScrollEdgeAppearance = a;
參考
https://developer.apple.com/forums/thread/684454。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/336753.html
