This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] [Android] Vertical scroll indicator appears on Label with limited vertical size inside ScrollView #9591
Labels
4.4.0
regression on 4.4.0
a/label
a/scrollview
e/2 🕑
2
i/regression
in-progress
This issue has an associated pull request that may resolve it!
p/Android
t/bug 🐛
Description
After upgrade to XF 4.4.0.991640 on Android, vertical scroll indicators appear on labels with limited vertical size, when the content does not fit into the label. The attached example uses an absolute layout and a HeightRequest in the label to achieve the scenario. A similar behavior can e.g. be observed in ListView cells (ListView without uneven row setting), where the height is limited as well.
Steps to Reproduce
Expected Behavior
No scroll bar / scroll indicator appears.
Actual Behavior
A scroll bar / scroll indicator appears for a short time after the label is being presented.
Basic Information
Screenshots
Reproduction Link
Minimal reproduction example: labelscrollbar.zip
Workaround
It seems that this issue is caused by #8090, as mentioned here. We've found two workarounds, which we used for labels and text entries, where we had a similar problem.
Workaround Option 1: Disable scroll bars in custom renderer
Disable vertical and/or horizontal scrollbars as needed. We've had a similar problem with
Entry
views, where a horizontal scrollbar appeared.Workaround Option 2: Use legacy constructor for renderer
This workaround has the disadvantage of using a deprecated constructor!
This workaround is based on the workaround for #9019 by @dminta (see here). It is based on the fact that the changes of #8090 only apply to the renderer constructor with Context as parameter. The passed context is wrapped with a style which enables vertical and horizontal scroll bars. I assume that Xamarin.Forms passes this wrapped context to child renderers of the scroll view renderer.
In contrast to @dminta's workaround, it's not the
ScrollViewRenderer
which is replaced in this workaround, but theLabelRenderer
. When replacing the scroll view renderer, the bug fixed by #8090 reappears - namely that the scroll bar does not appear for a scroll view. By replacing only the label renderer, the scroll bar of the scroll view still works.The text was updated successfully, but these errors were encountered: