正如您所看到的,在Android上按下按钮会出现意外行为!
<Button
HorizontalOptions="FillAndExpand"
Text="English"
Clicked="English_OnClicked"
Style="{StaticResource wizardButton}"/>
app.xml中:
<Style x:Key="wizardButton" TargetType="Button" BasedOn="{StaticResource buttonStyle}">
<Setter Property="BackgroundColor" Value="#3FFF" />
<Setter Property="BorderColor" Value="#FFFF" />
<Setter Property="TextColor" Value="#CFFF" />
<Setter Property="BorderWidth" Value="2" />
</Style>
<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="TextColor" Value="White" />
<Setter Property="BorderRadius" Value="4" />
<Setter Property="FontSize" Value="Medium" />
<Setter Property="BackgroundColor" Value="{StaticResource grayDark}" />
<Setter Property="HeightRequest">
<Setter.Value>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="50" />
</Setter.Value>
</Setter>
</Style>
我也在真实设备上检查过它,结果相同! Xamarin.Forms:2.3.4.267 构建目标是7.1