Hello,
Welcome to our Microsoft Q&A platform!
Yes,by default, the Grid
exists with the property RowSpacing
and ColumnSpacing
.
When we want to show many views , Gird
is recommended.
And If you don't want the blank space , you can set the RowSpacing
to 0
and ColumnSpacing
to 0
, just as follows:
<Grid RowSpacing="0" ColumnSpacing="0">
As a test, when I used the following code and set the RowSpacing
and ColumnSpacing
to 0
:
<Grid BackgroundColor="Transparent" Padding="0" HorizontalOptions="Fill" Margin="0" VerticalOptions="Start" ColumnSpacing="0" RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<RadioButton Content="▲Only" BackgroundColor="Yellow"/>
<RadioButton Grid.Column="1" Content="▼Only" BackgroundColor="Chocolate"/>
<RadioButton Grid.Column="2" Content="Both" IsChecked="True" BackgroundColor="Blue"/>
<RadioButton Content="▲Only" Grid.Row="1" Grid.Column="0" BackgroundColor="Green"/>
<RadioButton Content="▼Only" Grid.Row="1" Grid.Column="1" BackgroundColor="Green"/>
<RadioButton Grid.Row="1" Grid.Column="2" Content="Both" IsChecked="True" BackgroundColor="Green"/>
</Grid>
The result is:
And if we not set the ColumnSpacing="0" RowSpacing="0"
, then the result is:
Hope it can help you.
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.