【问题标题】:carouselview not working in xamarin formscarouselview 在 xamarin 表单中不起作用
【发布时间】:2018-12-15 18:04:42
【问题描述】:

在我的 xamarin 表单项目中,主页图像轮播中有两个轮播正在工作,但推荐旋转木马在 2 天前停止工作这是推荐 xamarin 表单项目的代码

.xaml 文件代码:

<StackLayout Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4">
   <Label Text="Testimonials" FontSize="15" TextColor="#3a5370" FontFamily="OpenSansBold.ttf#OpenSansBold" HorizontalTextAlignment="Center"/>
   <forms:CarouselView x:Name="TestimonialSlider">
      <forms:CarouselView.ItemTemplate>
         <DataTemplate>
            <StackLayout Orientation="Vertical" HorizontalOptions="Center">
               <Label Text="{Binding testitext}" HorizontalTextAlignment="Center"/>
               <Label Text="{Binding owner}" HorizontalTextAlignment="Center" FontAttributes="Bold"/>
            </StackLayout>
         </DataTemplate>
      </forms:CarouselView.ItemTemplate>
   </forms:CarouselView>
</StackLayout>

xaml.cs 文件代码:

public class testicar
{
    public string testitext { get; set; }
    public string owner { get; set; }
}

List<testicar> testimonial;

public HomePage()
{
    InitializeComponent();

    testimonial = new List<testicar>();

    testimonial.Add(new testicar
    {
        testitext = "hi",
        owner = "how are you ?"
    });

    testimonial.Add(new testicar
    {
        testitext = "hi",
        owner = "how are you ?"
    });

    testimonial.Add(new testicar
    {
        testitext = "hi",
        owner = "how are you ?"
    });

    TestimonialSlider.ItemsSource = testimonial;
}

【问题讨论】:

    标签: c# xaml xamarin xamarin.forms visual-studio-2017


    【解决方案1】:

    应该有身高问题。您的内容与图像重叠。只是玩高度并检查。应该可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-25
      • 2014-12-26
      • 2017-09-19
      • 1970-01-01
      • 1970-01-01
      • 2019-10-12
      • 2019-10-07
      相关资源
      最近更新 更多