我有这样的风格:
<Style x:Key="pointButton" TargetType="Button">
<Setter Property="BorderColor" Value="#999999"/>
<Setter Property="BorderWidth" Value="1" />
<Setter Property="TextColor" Value="#AAAAAA" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="VerticalOptions" Value="StartAndExpand" />
<Setter Property="Margin" Value="10,10,10,10" />
<Setter Property="HeightRequest" Value="40" />
</Style>
我想把这一点包括在内。这可能吗?
<Button.FontSize>
<OnPlatform x:TypeArguments="x:Double" iOS="25" Android="20" />
</Button.FontSize>
2条答案
按热度按时间tyu7yeag1#
通过新的XamarinOnPlatformspecification,可以直接在style标签中定义平台样式:
j9per5c42#
将每个属性定义为OnPlatform
并以yout按钮样式引用它,如