Mik*_*ken 4 xaml android ios xamarin xamarin.forms
我有一个 Xamarin Forms 项目,我需要一个自定义按钮。该按钮看起来像这样:
我假设我需要创建一个自定义渲染器,但我不知道如何在按钮内有两种不同的字体大小?
我需要 Android 和 iOS 的渲染器。任何帮助将不胜感激。谢谢!
如何跳过自定义渲染器并使用Frame
包含格式化文本的点击手势Label
:
<Frame VerticalOptions="Center" HorizontalOptions="Center" CornerRadius="10" BackgroundColor="Gray" BorderColor="Black">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="OnFrameTapped"/>
</Frame.GestureRecognizers>
<Label>
<Label.FormattedText>
<FormattedString>
<Span Text="2" FontSize="30" />
<Span Text="ABC" FontSize="15" />
</FormattedString>
</Label.FormattedText>
</Label>
</Frame>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1742 次 |
最近记录: |