【问题标题】:Xamarin.Forms Buttons on Image图像上的 Xamarin.Forms 按钮
【发布时间】:2019-07-10 20:42:00
【问题描述】:

需要帮助,我是 Xamarin 的初学者。

Help with 1 and 2

如何将 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>

【问题讨论】:

    标签: xaml xamarin xamarin.forms


    【解决方案1】:

    试试这个: 您还需要为 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>
    

    【讨论】:

      猜你喜欢
      • 2018-11-21
      • 1970-01-01
      • 2017-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-16
      相关资源
      最近更新 更多