1 回答

TA貢獻(xiàn)1770條經(jīng)驗(yàn) 獲得超3個(gè)贊
不幸的是,Xamarin 不能使用 WPF 的 ResourceDictionary。
您可以創(chuàng)建和使用 Xamarin 的 ResourceDictionary,如下所示。
<Application ...>
? ? <Application.Resources>
? ? ? ? <ResourceDictionary>
? ? ? ? ? ? <Color x:Key="PageBackgroundColor">Yellow</Color>
? ? ? ? ? ? <Color x:Key="HeadingTextColor">Black</Color>
? ? ? ? ? ? <Color x:Key="NormalTextColor">Blue</Color>
? ? ? ? ? ? <Style x:Key="LabelPageHeadingStyle" TargetType="Label">
? ? ? ? ? ? ? ? <Setter Property="FontAttributes" Value="Bold" />
? ? ? ? ? ? ? ? <Setter Property="HorizontalOptions" Value="Center" />
? ? ? ? ? ? ? ? <Setter Property="TextColor" Value="{StaticResource HeadingTextColor}" />
? ? ? ? ? ? </Style>
? ? ? ? </ResourceDictionary>
? ? </Application.Resources>
</Application>
- 1 回答
- 0 關(guān)注
- 162 瀏覽
添加回答
舉報(bào)