【发布时间】:2021-12-16 11:32:48
【问题描述】:
所以我有我的 App.xaml :
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Fitness_App.App">
<Application.Resources>
<ResourceDictionary>
<Style x:Key="WorkoutStyle" TargetType="Label">
<Setter Property="FontSize" Value="28"/>
<Setter Property="FontFamily" Value="BebasNeue"/>
<Setter Property="TextColor" Value="Wheat"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
就我阅读微软文档而言,我在这里声明了一种样式 GLOBALLY。但是,当在另一个 xaml 文件中我这样做时:
<Label Style= "{StaticResource WorkoutStyle}"
它说找不到 WorkoutStyle。知道为什么吗?
【问题讨论】:
-
你建了吗?
标签: c# xaml xamarin xamarin.forms styles