【发布时间】:2020-07-03 11:11:45
【问题描述】:
我想在 CarouselView 页面的最后一页中添加一个按钮,任何人都可以帮助我吗?
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:local="clr-namespace:sing"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="sing.Welcome"
BackgroundColor="#ff4949">
<ContentPage.BindingContext>
<local:Items/>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout>
这是我的轮播视图,在我的 ViewModels 中有绑定项
<CarouselView ItemsSource="{Binding Monkeys}"
IndicatorView="indicatorView">
<CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout>
<Frame HasShadow="False"
CornerRadius="5"
Margin="0,50,0,0"
HeightRequest="300"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"
BackgroundColor="#ff4949">
<StackLayout>
<Image Source="{Binding ImageUrl}"
Aspect="AspectFill"
HeightRequest="300"
WidthRequest="300"
HorizontalOptions="Center" />
</StackLayout>
</Frame>
</StackLayout>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
继续 ::::::::
<IndicatorView x:Name="indicatorView"
IndicatorsShape="Circle"
IndicatorColor="LightGray"
SelectedIndicatorColor="Yellow"
HorizontalOptions="Center"
Margin="0,0,0,40" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
是否可以在最后一页添加按钮?
【问题讨论】:
-
你能得到最后的位置吗?
标签: xamarin xamarin.forms view carousel