smartsoldier
smartsoldier

Reputation: 153

Xamarin.forms button align

I want to make the button nice however there seems to be a gap between the two buttons. Is there any way to make the gap closer so it's nicer? I've attached a screenshot for reference

enter image description here

These are my current code for my design.

<Grid Grid.Row="1">
     <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>

 <Button Text="View Event" BackgroundColor="#d3d3d3" TextColor="Black" />
<Button  Grid.Column="1" Text="Cancel" BackgroundColor="#d3d3d3" TextColor="Black"/>
 </Grid>

Upvotes: 2

Views: 2278

Answers (2)

Adit Kothari
Adit Kothari

Reputation: 63

Here in Grid.ColumnSpacing has a value of 6 by default so try setting that to 0:..So this will solve your problem

Upvotes: 0

hvaughan3
hvaughan3

Reputation: 11105

Grid.ColumnSpacing has a value of 6 by default so try setting that to 0:

<Grid Grid.Row="1"
      ColumnSpacing="0">
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>

 <Button Text="View Event" BackgroundColor="#d3d3d3" TextColor="Black" />
<Button  Grid.Column="1" Text="Cancel" BackgroundColor="#d3d3d3" TextColor="Black"/>
</Grid>

You might also want to set Button.BorderRadius to 0 and add a border around the buttons.

Upvotes: 2

Related Questions