丙烯酸刷子总是回落到Fallbackcolor.
建立:
目标版本:Windows 10(1803)
最低版本:windows 10 Fall Creators Update(16299).
而且我也在检查
windows.Foundation.Metadata.APIinformation.IsTypePresent(“windows.UI.Xaml.Media.AcrylicBrush”)可用.
使用任何预定义的丙烯酸笔刷会导致“找不到具有名称/密钥SystemControlChromeLowAcrylicWindowBrush的资源”.
AcrylicBrush& SplitvIEw风格:
<media:AcrylicBrush x:Key="HostBackdropBrush" BackgroundSource="HostBackdrop" Tintcolor="White" Tintopacity="0.4" Fallbackcolor="WhiteSmoke" /> <Style targettype="SplitVIEw"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> <Setter Property="OpenPaneLength" Value="{themeResource SplitVIEwOpenPanethemeLength}"/> <Setter Property="CompactPaneLength" Value="{themeResource SplitVIEwCompactPanethemeLength}"/> <Setter Property="PaneBackground" Value="{StaticResource HostBackdropBrush}"/> </Style>
自定义渲染器:
[assembly: ExportRenderer(typeof(MasterPage),typeof(MasterPageRenderer))]namespace MasterDetailPageNavigation.UWP{ class MasterPageRenderer : PageRenderer { protected overrIDe voID OnElementChanged(ElementChangedEventArgs<Page> e) { base.OnElementChanged(e); if (e.oldElement != null || Element == null) { return; } try { if (windows.Foundation.Metadata.APIinformation.IsTypePresent("windows.UI.Xaml.Media.XamlCompositionBrushBase")) { windows.UI.Xaml.Media.AcrylicBrush myBrush = new windows.UI.Xaml.Media.AcrylicBrush(); myBrush.BackgroundSource = windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; myBrush.Tintcolor = windows.UI.color.FromArgb(255,200,200); myBrush.Tintopacity = 0.2; Background = myBrush; } else { SolIDcolorBrush myBrush = new SolIDcolorBrush(windows.UI.color.FromArgb(255,240,240)); Background = myBrush; } } catch (Exception ex) { System.Diagnostics.DeBUG.Writeline(ex); } } protected overrIDe windows.Foundation.Size ArrangeOverrIDe(windows.Foundation.Size finalSize) { return base.ArrangeOverrIDe(finalSize); } }} ```解决方法 请看下面的项目:
stackoverflow.com/a/13563083/4373895
这应该可以解决您的问题.您可以通过将themeResources.xaml添加到项目资源来解决此问题.
总结以上是内存溢出为你收集整理的c# – Xamarin.Form问题的流畅设计全部内容,希望文章能够帮你解决c# – Xamarin.Form问题的流畅设计所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)