Xaml 样式未应用于Xamarin.Forms中的按钮?
我正在处理的ContentPage中有这种样式:Xaml 样式未应用于Xamarin.Forms中的按钮?,xaml,xamarin,xamarin.forms,Xaml,Xamarin,Xamarin.forms,我正在处理的ContentPage中有这种样式: <ContentPage.Resources> <ResourceDictionary> <Style x:Key="buttonStyle" TargetType="Button"> <Setter Property="BorderColor" Value="Orange"/> <Set
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="buttonStyle" TargetType="Button">
<Setter Property="BorderColor" Value="Orange"/>
<Setter Property="BorderRadius" Value="5"/>
<Setter Property="BorderWidth" Value="5"/>
<Setter Property="TextColor" Value="Orange"/>
<Setter Property="BackgroundColor" Value="Transparent"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="HorizontalOptions" Value="EndAndExpand"/>
</Style>
</ResourceDictionary>
</ContentPage.Resources>
并将其应用到按钮上:
<Button Grid.Row="0" Grid.Column="0" Text="New user" Style="{StaticResource buttonStyle}"/>
我想要完成的是这样的事情(用MS Paint绘制):
但这就是我(从Android emulator)得到的:
我觉得代码很好
请尝试卸载应用程序并删除bin和obj文件夹,然后重新生成并部署。我觉得代码很好 请尝试卸载应用程序并删除bin和obj文件夹,然后重新生成并部署