【发布时间】: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