3
設置樣式值在xamarin形式風格(在XAML中定義),我可以定義值特定平臺的,就像這樣:Xamarin.Forms:如何只在特定平臺
<OnPlatform x:TypeArguments="Font" Android="30" iOS="40" WinPhone="20" x:Key="TitleFontSize" />
<Style x:Key="MyTitleLabel" TargetType="Label"">
<Setter Property="Font" Value="{StaticResource TitleFontSize}" />
</Style>
可我還定義了風格的方式,使「字體」的價值保持默認(根本沒有設置)的一些plarforms?
事情是這樣的:
<Style x:Key="MyTitleLabel" TargetType="Label"">
<OnPlatform>
<OnPlatform.Android>
<Setter Property="Font" Value="30" />
</OnPlatform.Androud>
</OnPlatform>
</Style>