Jan*_*vil 6 winrt-xaml windows-phone-8.1
我有一个PageWinRT Windows Phone 8.1应用程序.此页面已RequestedTheme设置为ElementTheme.Light.系统主题(在系统设置中设置)设置为黑暗.
当我打开一个ListPickerFlyout(使用Button.Flyout)时,结果如下:

似乎前景色适当地变为黑色,但背景保持黑暗主题(非常深灰色).
弹出窗口中没有背景属性,是否有办法强制它符合Page的RequestedTheme?
好问题!
在应用程序资源中,您可以覆盖名为FlyoutBackgroundThemeBrush for Light主题的资源.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="FlyoutBackgroundThemeBrush" Color="Green" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
这将使其成为概念验证的绿色.:)
问题是,弹出窗口不使用Page的RequestedTheme,而是App的RequestedTheme.
在这种情况下,解决方案是设置Application.Current.RequestedTheme = ApplicationTheme.Light除了设置Page.RequestedTheme = ElementTheme.Light.
| 归档时间: |
|
| 查看次数: |
929 次 |
| 最近记录: |