2
我正在使用7行3列的网格。我添加了一个按钮,第7行和第3列是这样的:Xamarin表格在网格中右对齐按钮
<Button Grid.Row="6" Grid.Column="2" HorizontalOptions="End"/>
的问题是按钮始终处于中心位置。我似乎无法让它走到最后。 这里的结构
<Image Aspect="AspectFit" HeightRequest="60" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" Source="{Binding ProdImg}" />
<Label Grid.Row="0" Grid.Column="1" HorizontalOptions="Start" TextColor="White" FontSize="22" Text="{Binding UserName}"/>
<Label HorizontalOptions="End" Grid.Row="0" Grid.Column="2" TextColor="#b1fc03" FontSize="25" Text ="{Binding Sales, StringFormat='{0:#,#.}'}"/>
<Label Grid.Row="1" Grid.Column="1" HorizontalOptions="Start" TextColor="White" FontSize="10" Text="{Binding LastSale, StringFormat='{0:dd-MMM-yyyy}'}"/>
<Label HorizontalOptions="End" Grid.Row="1" Grid.Column="2" TextColor="White" FontSize="10" Text="{Binding ProdName}"/>
<Button x:Name="TryNowBtn" HorizontalOptions="End" Image="try-now.png" Grid.Row="2" Grid.Column="2"></Button>
</Grid>
</StackLayout>
<Image Aspect="AspectFit" Source="separator-line.png"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
我也试过
View.HorizontalOptions="End"
你可以粘贴XAML为休息吗?它现在在开头标记结束。 –
DavidS
我加了剩下的xaml – jbassking10
你能告诉你如何定义网格高度权重..这些标签和图像实际上是无关紧要的。 – Lee