Reputation: 30
From what I've read, a plain Xamarin button allows text but no background image. A Xamarin ImageButton allows for an image, but no text. So how can I get both without shelling out for a SyncFusion licence?
Upvotes: 0
Views: 2256
Reputation:
You can use grid to put text on ImageButton. You need to put Label and button same row.
<Grid HorizontalOptions="Center"
VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ImageButton HorizontalOptions="Center" VerticalOptions="Center"
Source="Xamarin_logo.jpg"
Grid.Row="0"/>
<Label HorizontalOptions="Center" VerticalOptions="Center"
Text="button"
TextColor="Purple"
FontSize="Large"
Grid.Row="0"/>
</Grid>
Upvotes: 2