I have a Xamarin Forms project, and I need to have a custom button. The button would look something like this:
I assume I need to create a custom renderer, but I can't figure out how to have two different font sizes inside a button?
I need renderers for both Android and iOS. Any help would be greatly appreciated. Thanks!
How about skipping the custom renderer and use a Frame
w/ a tap gesture that encloses a formatted text 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With