我正在寻找一种方法来更改 C# 中的 Grid.column 和 Grid.Row Xaml 值,但我不知道如何更改
这是我的 Xaml 代码:
<StackLayout HorizontalOptions="FillAndExpand" Orientation="Horizontal" VerticalOptions="FillAndExpand" Grid.Row="1" >
<Label FontSize="27" Text="⦿" TextColor="White" x:Name="otherbookslabel" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="OnOtherNews" />
</Label.GestureRecognizers>
</Label>
<Grid RowSpacing="5" ColumnSpacing="5" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" x:Name="MainGridNews" >
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="AliceBlue" x:Name="GridRectangle" ></StackLayout>
<StackLayout Grid.Row="1" Grid.Column="0" BackgroundColor="Beige" x:Name="GridCarreGaucheMilieu" ></StackLayout>
<StackLayout Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" BackgroundColor="Accent" x:Name="GridCarreDroiteBas" ></StackLayout>
<StackLayout Grid.Row="2" Grid.Column="0" BackgroundColor="OldLace" x:Name="GridCarreGaucheBas" ></StackLayout>
</Grid>
</StackLayout>
我在 C# 中启动了该函数:
public void OnOtherNews(object sender, EventArgs e) {
}
在此先感谢您的帮助
胡说叔叔
相关分类