C
C#3y ago
Down

❔ xamarin forms displaying text in 1 line with spacing

how can i distribute text that first is at the start of the line second is in the middle and third is at the end do i make stack layout horizontal and put 3 labels inside? still how to space them
16 Replies
.kimba
.kimba3y ago
Choose a Xamarin.Forms Layout - Xamarin
Xamarin.Forms layout classes allow you to arrange and group UI controls in your application.
.kimba
.kimba3y ago
Suggest you making a Horizontal Stack Layout then set Margins
Down
DownOP3y ago
hm FlextLayout also looks good
.kimba
.kimba3y ago
it's up to what you wish 😛
Down
DownOP3y ago
so i tried using flex but looks like this
Down
DownOP3y ago
the middle numbers arent lined up
.kimba
.kimba3y ago
align = center?
Down
DownOP3y ago
you mean AlignContent?
.kimba
.kimba3y ago
probably :p check the link I sent
Down
DownOP3y ago
doesnt solve it
.kimba
.kimba3y ago
most likely its there
Down
DownOP3y ago
there is alignitems let me try that nope both doesnt solve it do i need to use some kind of grid?
.kimba
.kimba3y ago
that's why I suggested Stack Layout that way you can align all by the middle you make three vertical stack layouts but to be honest you should ask another person for help because I'm not too good with this 😅
lycian
lycian3y ago
Did you try using the demo app? https://github.com/xamarin/xamarin-forms-samples/tree/main/UserInterface/FlexLayoutDemos If you can't get the experimentation to work how you want, I'd suggest using a grid. In general for this layout a grid is probably better, but I think it can be achieved with FlexLayout
GitHub
xamarin-forms-samples/UserInterface/FlexLayoutDemos at main · xamar...
Sample apps built using the Xamarin.Forms framework - xamarin-forms-samples/UserInterface/FlexLayoutDemos at main · xamarin/xamarin-forms-samples
TotechsStrypper
You need to use the datagrid, if not you have to use the grid each cell for columns division and always binding to the width of each column content take (Which lead to huge potential performance issues)
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?