【发布时间】:2015-08-13 17:00:23
【问题描述】:
我有一个使用 Visual Studio 2013 的 Xamarin.Forms (1.4.2.6359) 项目,并在下面创建了轮播页面。我想添加页面指示器,即轮播页面顶部的点。这可以通过 Xamarin Forms CarouselPage 完成吗?
public class SplashPage : CarouselPage
{
public SplashPage ()
{
this.Children.Add(new CarouselChild("Logo.png", "Welcome"));
this.Children.Add(new CarouselChild("Settings.png", "Settings"));
}
}
class CarouselChild : ContentPage
{
public CarouselChild(string image, string text)
{
StackLayout layout = new StackLayout
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
};
layout.Children.Add(new Image
{
Source = image,
});
layout.Children.Add(new Label
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.EndAndExpand,
Text = text,
Scale = 2,
});
this.Content = layout;
}
}
【问题讨论】:
标签: c# xamarin carousel xamarin.forms