Padding
Note: Many elements support margins, but few support padding. You'll be tempted at first to apply padding to controls like Labels. You'll find that this does not work. Instead you'll need to wrap the Label in a Layout (e.g. StackLayout) and apply the padding to that.
Below are the utility classes for adding padding.
The format for specifying margins is
.p{sides}-{size}
.Where the sizes is one of the follow:
t
- topb
- bottoml
- leftr
- rightx
- left and righty
- top and bottom- blank for all
And the size is one of the following:
0
- none1
- 0.25rem2
- 0.5rem4
- 0.75rem8
- 2rem12
- 3rem16
- 4rem24
- 6rem32
- 8 rem64
- 16rem
<StackLayout StyleClass="p-3">
<Label Text="Lots of trouble. Lots of bubble." />
</StackLayout>
This would provide a 10 unit padding on all sides.
<StackLayout StyleClass="pt-3">
<Label Text="Lots of trouble. Lots of bubble." />
</StackLayout>
This would provide a 10 unit padding on the top.
Last modified 3yr ago