[英]Xamarin.Forms Buttons on Image
需要幫助,我是Xamarin的初學者。
如何在圖像上放置1個和2個按鈕? 我的XAML:
<carousel:CarouselViewControl Orientation="Horizontal" InterPageSpacing="0" Position="0" ItemsSource="{Binding Images}"
ShowIndicators="True"
Grid.Row="1" HeightRequest="250">
<carousel:CarouselViewControl.ItemTemplate>
<DataTemplate>
<Image Source="{Binding ImSource}" Grid.Row="1" Aspect="AspectFill" />
</DataTemplate>
</carousel:CarouselViewControl.ItemTemplate>
</carousel:CarouselViewControl>
試試這個:您還需要為Im1和Im2設置邊距
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Grid.RowSpan="3"
Source="{Binding ImSource}"
Aspect="AspectFill"
/>
<ImageButton
Grid.Row="0"
Source="{Binding Im1}"
HorizontalOptions="End" />
<ImageButton
Grid.Row="2"
Source="{Binding Im2}"
HorizontalOptions="Start"/>
</Grid>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.