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

StackLayout dynamic size

$
0
0

I can't post much code as it's all NDA and all that, but hopefully I can paint the picture properly. I essentially have a page with a ListView on it that represents a list of forum posts. The ListView view cell is setup to take a ForumPostView control which has title, message, photo, etc on it. I want to be able to show replies to the forum post in the form of any number of ForumPostReply controls. My ForumPostView control has a stacklayout which, when the BindingContext object (a post message) has any replies, dynamically adds replies to the stacklayout.

Everything works great, it all looks perfect but I have an issue. If my screen opens with a post that has a reply on it, it doesn't draw correctly. If I scroll the list down, it reshuffles and then draws itself correctly. The reply is kind of there but you can tell that the outer ForumPostView object hasn't expanded itself to cater for the reply. Scrolling down so the post is out of sight causes the layout to fix itself and when you scroll back, it looks right.

Any ideas? I appreciate it's difficult to tell without code but it seems like my ForumPostView doesn't draw itself initially until I guess it invalidates...


Viewing all articles
Browse latest Browse all 89864

Trending Articles



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