troubleshooting Question

Is there a way to set auto height for StackLayout in Xamarin?

Avatar of tangteng78
tangteng78Flag for Malaysia asked on
* xamlC#* Xamarin.NET MVC.NET Programming
7 Comments1 Solution13 ViewsLast Modified:
Hi,
I'm having issue of content being "cut" when I'm using StackLayout  (inside of a ScrollView). As my contents are dynamic, some of the contents are long, thus the height of the StackLayout  will be extended. However, the issue can be solved by setting the physical height (2000 in my case).

<ScrollView HorizontalOptions="FillAndExpand">
<StackLayout Padding="5" Spacing="5" VerticalOptions="Start" HeightRequest="2000">

However this solution is not "friendly" as for a short content, it will leave a big gap at the bottom.

If you guys have any workaround or a better idea how to do this, it would be greatly appreciated.

ASKER CERTIFIED SOLUTION
David H.H.Lee
Digital Marketing (Hospitality)
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros