我在xamarin视图中有一个Carousel。在网格视图中有Carousel。也有一个按钮,但是问题是按钮未正确放置。我想将注册按钮littlebit放在上方和整个宽度。
这是我的看法
我的密码
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:InfutureMob"
x:Class="InfutureMob.MainPage"
xmlns:cv="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView">
<Grid RowSpacing="0" Grid.RowSpan="2">
<!--<Grid.RowDefinitions>
<RowDefinition Height=".3*"/>
<RowDefinition Height=".7*"/>
</Grid.RowDefinitions>-->
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<cv:CarouselView ItemsSource="{Binding Zoos}" x:Name="CarouselImages" >
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Aspect="AspectFill" Source="{Binding ImageUrl}"/>
<StackLayout Grid.Row="1" BackgroundColor="#80000000" Padding="12">
<Label TextColor="White" Text="{Binding Name}" FontSize="16" HorizontalOptions="Center" VerticalOptions="CenterAndExpand"/>
</StackLayout>
</Grid>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>
<StackLayout Orientation="Horizontal" HorizontalOptions="StartAndExpand" Margin="20,20,20,0" Grid.Row="2">
<Button Text="Register" BackgroundColor="#3897f0" TextColor="White" HeightRequest="50" VerticalOptions="Start" />
</StackLayout>
</Grid></ContentPage>
犯罪嫌疑人X
相关分类