Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Centering text in a button

$
0
0

I've got a button in a grid row. The button is full width, and the text is centered. Awesome.
I then put the button into a stacklayout (still in the grid). Now the button is full width, but the text is left justified.
The reason for adding the stacklayout is to add some padding around the button. I could probably solve this by adding a grid with three columns.

I have:

<Grid>
  <StackLayout>
    <Button text="foo"/>
  </StackLayout>
</Grid>

Is there some property that I need to set on stacklayout that is normally a default?
I don't see any way to control the text location in the button, and the button size and position is correct.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>