有什么方法可以忽略我的应用Xamarin表单中的黑暗模式(Android)
要忽略黑暗模式,我唯一使用的是,
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
但是对我来说效果不佳,因为当导航到WebView并返回我没有配置为白色背景色的条目时,它们会变成黑色。
输入应用程序时进入 - > 1
导航Web视图并返回 - > 2
条目的实例化解决
var lastNameEntry = new Entry
{
Placeholder = "Apellido",
TextColor = Color.Black,
ReturnType = ReturnType.Next,
};
方案是我的解决方案= color。条目但是有其他选择吗?
To ignore the dark mode the only thing I am using is
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
But it does not work well for me since when navigating to a WebView and returning the entries that I do not have configured with white backgroundcolor they turn black.
entry when entering the app -> 1
After navigating a web view and return -> 2
The instantiation of the entry
var lastNameEntry = new Entry
{
Placeholder = "Apellido",
TextColor = Color.Black,
ReturnType = ReturnType.Next,
};
The solution I have is to put BackGroundColor = Color.White in all the entries but is there any alternative to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题。我解决了如下所述的问题。
修改style.xml文件:
修改mainActivity.cs文件:
theme =“@style/maintheme” the them =“@style/maintheme.base”
oncreate方法开始像这样
i was having the same problem. I solved the problem as described below.
Modify the styles.xml file:
Modify the mainactivity.cs file:
Theme = "@style/MainTheme" to Theme = "@style/MainTheme.Base"
OnCreate method starts like this