【发布时间】:2021-09-02 20:36:30
【问题描述】:
我有一个来自 StaticRecourse 的样式的条目,但是 iOS 和 Android 是否可以有 2 种不同的样式
<Entry
x:Name="Partijladen"
Grid.Row="15"
Grid.Column="4"
Grid.ColumnSpan="2"
Keyboard="Numeric"
Style="{StaticResource AEntry}"
TextChanged="Partijladen_TextChanged" />
这是可行的,但我想要一个不同的 Android 风格让我们说“BEntry”。我在这里改变什么是不可能的
Style="{StaticResource AEntry}"
在 App.xaml 中
<Style x:Key="AEntry" TargetType="Entry">
<Setter Property="TextColor" Value="#2c2c2e" />
<Setter Property="WidthRequest" Value="80" />
<Setter Property="HeightRequest" Value="10" />
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
<Style x:Key="BEntry" TargetType="Entry">
<Setter Property="TextColor" Value="DarkGreen" />
<Setter Property="FontSize" Value="25" />
<Setter Property="WidthRequest" Value="80" />
<Setter Property="HeightRequest" Value="10" />
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>
试过了,但是出错了
【问题讨论】:
标签: xaml xamarin.forms staticresource