Xamarin.iOS状态栏在更改其文本颜色时消失 [英] Xamarin.iOS Status Bar Disappears When Changing Its Text Color
问题描述
更改文字颜色时,如何避免在Xamarin.iOS上隐藏状态栏?
How do I avoid hiding the Status Bar on Xamarin.iOS when changing its text color?
尝试更改我的iOS状态栏的颜色后,我没有状态栏了.
After trying to change the color of my iOS Status Bar, I don't have a status bar anymore.
我删除了在info.plist
中添加的属性,但随后状态栏文本颜色仍为黑色.
I remove the property I added in info.plist
, but then my status bar text color remains black.
这就是我所做的,遵循以下步骤:
- 更新了
info.plist
,添加了布尔属性View Controller-Based Status Bar Appearance
并将其设置为No
- 添加到App.cs的主页面中,该主页面是一个导航页面,
BarTextColor = Color.White
- Updated
info.plist
adding the boolean propertyView Controller-Based Status Bar Appearance
and set it toNo
- Added in the App.cs, in my MainPage which is a NavigationPage,
BarTextColor = Color.White
推荐答案
有两种方法可以隐藏iOS状态栏.以下是Xamarin.iOS源代码中要验证的内容:
There are a couple ways to hide the iOS Status Bar. Here are the things to verify in the Xamarin.iOS source code:
在Info.plist
中,确保Status bar is initially hidden
是No
搜索代码以找到对UIApplication.SharedApplication.StatusBarHidden
的任何引用,并确保其为false
Search the code to find any references to UIApplication.SharedApplication.StatusBarHidden
and ensure that it is false
这篇关于Xamarin.iOS状态栏在更改其文本颜色时消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!