-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Android - ScrollView truncates items when using StackLayout BindableLayout #13597
Comments
Hi, @DatBear - thanks for submitting this issue! I'm able to reproduce it and the behavior is certainly strange - as you mentioned, the bottom views seem to disappear when tapping the "Add Data" button to add data. This occurs on Android, whereas this is not an issue on iOS. This also appears to be a regression, as it works fine on XF 4.8 |
I also stumbled upon this bug, the setup is exactly the same. |
This problem isn't limited to StackLayout, this occurs in Grid as well. As long as items are added and goes out of screen. All items in the ScrollView that are out of screen are truncated. Change the orientation of the emulated/physical Android device and the truncated items will appear. |
Same thing happens to me too, except I don't have This only happens if the contents goes beyond the end of the screen. I tried using a |
Was trying to make sense of the issue and tested all 5.0.0 versions (including prereleases), In my project, I use StackLayout with BindableLayout.ItemsSource, changing orientation renders all items correctly. output1.mp4 |
Same here... Wrapping the ScrollView with a ContentView fixes the issue in my case. |
Hit the same .. few stacklayots (as sections) within scrollview. some stacklayouts hidden on start and then may be shown depending on radio button states (through binded properties). items at the end got partially hidden. however. the scrollview sizing seems to be good. working good in latest 4.8 wrapping in contenview solved this
|
Thank you for the work arounds. Any chance we can have this looked at sometime soon? |
I am still having this same issue in June 2021...thanks for the workaround! |
@PureWeen Any news on this, maybe? The workaround it's good, but I think we need an XF solution to this, to avoid adding more complexity to our views. Also, @jsuarezruiz maybe you can take a look to this too ? |
Having Save issue. Any further updates? Hoping it will be fixed in the next xamarin Form update. |
Same thing happen here, spent nearly half day to figure out what was the problem (thought was my own mistake) before seeing this post. |
Same thing happening to me, It would be great if we could get an estimate or an update. This issue is preventing us from releasing our product for Android. |
I used ContentView (it contain StackLayout). It worked for me. |
I've spent couple of hours to figure out why scroll view is truncating data found no logical issue in my code then decided to google it and here I am, so it's been more than 6 month since this issue is reported here I'm surprised it's not resolve yet. |
Any update on this issue? this is happening to us as well. |
I found this happens when you use scroll view control directly inside ContentPage.Content The solution is to wrap the scroll view with a stack layout. Example : <ContentPage.Content> <ContentPage.Content> |
I have used @phamkimtho's solution and that seems to work for now, on the latest XF 5 (5.0.0.2083). Still not digesting the issue. 👎 |
I recently had this problem too when adding controls to a StackLayout inside a ScrollView programmatically, no binding. Triggering what I assume to be some kind of screen redraw (interacting with a text box, taking screenshot) would reveal the truncated content. I spent hours fiddling with different options until someone directed me to this issue and the workaround @gdang suggested which "fixed" it immediately. |
This comment has been minimized.
This comment has been minimized.
Having the same issue when using a stack layout inside a scroll view on Android. If the content inside the stack layout expands, e.g. when an error message is added below and entry field, the content at the bottom of the scroll view is truncated. |
This comment has been minimized.
This comment has been minimized.
My fix for this issue is binding the Scrolleview Orientation property to a ScrollOrientation type property and force to read it by calling OnPropertyChanged with the property name when you need the scollview to recaculate it's height. Make sure you set the orientation to a different value that it's current value or it will not work. You can do this by toggeling between ScrollOrientation.Both and ScrollOrientation.Vertical for example. |
@michelmoorlag that seems more like a workaround than a fix :D but thank you for this! This might also give some kind of hint on how to fix this. |
Maybe it is connected to the bug #14918, or #14398. ScrollView has very bad issues in situation when the height of its content is changed on Android (lazy loaded views, or when some previously invisible view becomes visible). I will try if your ContentView workaround works also for these bugs. Edited: I have test it and the ContentView workaround works also for the two other mentioned bugs. So maybe they are caused by the same issue. Many thanks for this workaround. |
Hey all if you are still with us, a PR (#15067) for this is open now that potentially fixes this, would you be able to grab the NuGet as described here and let us know if this fixes this issue? That will greatly speed up the review process. Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂 Thanks! |
Just tried version 5.0.0.7396 but it did not solve the issue :( |
I missunderstood :), thought that version 5.0.0.7396 would solve the issue, but you are right @heikow10, it is version 5.0.0.7996 that fixes the problem, and it seems that it is working as expected :) |
Ok. Thanks for the information and your tests, @cn5! |
For testing these PR fixes you should use a very specific version indeed :) glad we could figure it out and thanks for the help on this! |
The Solution was:
|
This should be fixed by #15076 and part of SR10 |
Thank you @julioroldan Your fixed worked fine for me. Should you close bugs before fix is released @jfversluis ? (Im on 5.0.0.2337 latest official version, and it still has this bug) |
@jfversluis Fix is indeed not the correct term here, it is indeed a work around. When will SR10 be released? |
Yes, it's closed whenever a fix is merged pending release. SR10 should be here soon |
I can confirm that installing XF 5.0.0.2401 fixed it for me. |
Perfect, thanks for letting us know @michelmoorlag ! |
Hi @jfversluis I seem to be suffering the same effect however my issue is am using DevExpress Popup Control and Xamarin Forms Lattest on Android. Please see video of issue https://screenrec.com/share/rcL4RbwBnK I cant tell what is going wrong here. |
Description
StackLayout with BindableLayout items inside a ScrollView causes the ScrollView to truncate the items near the bottom.
Steps to Reproduce
On Android
Expected Behavior
Scrollview will update viewable size to show all items when scrolling down.
Actual Behavior
Scrollview truncates items at the bottom of the scrollview.
Basic Information
Screenshots
Before adding an item to the BindableLayout.ItemsSource collection:
After adding an item to the StackLayout BindableLayout.ItemsSource collection:
Reproduction Link
https://github.com/DatBear/ScrollViewBug
Workaround
Edit: Wrapping the ScrollView in a ContentView seems to be a good workaround.
The text was updated successfully, but these errors were encountered: