Xamarin.forms: [Bug] Scrollview scrollbar not visible on Android

Created on 23 Sep 2019  路  7Comments  路  Source: xamarin/Xamarin.Forms

Description

I want to show scrollbar in scrollview, so I tried to set this.VerticalScrollBarEnabled = true; this.ScrollbarFadingEnabled = false; in custom renderer of ScrollViewRenderer in Android project , it only works under Xamarin.Forms 3.4.xx , and it crash with the error message Java.Lang.NullPointerException: Attempt to invoke virtual method 'android.widget.ScrollBarDrawable on XF 3.5.xxx, when i set XF version later than 3.5. m, crash doesn't happen but the scrollbar never shows up .

Steps to Reproduce

  1. Open the project i upload
  2. Downgrade XF version to 3.4 to see if the scrollbar is visible.
  3. Downgrade XF version to 3.5 to see if it crashes.
  4. Set XF version later than 3.5 to see if the scrollbar is visible .

Expected Behavior

scrollbar in scrollview always visible

Actual Behavior

Crash on XF 3.5 and scrollbar invisible after XF 3.5.
FormsApplication.zip

in-progress Android bug

Most helpful comment

The fix has been reverted. So this bug should be reopened too.
It seems still to be a current problem (using todays version)

All 7 comments

Normally I'd tell you to set the VerticalScrollBarVisibility property on your ScrollView, but that appears to be broken as well.

It's not just scrollview.
There's also a listview.
VerticalScrollBarVisibility does not work on android.

The fix has been reverted. So this bug should be reopened too.
It seems still to be a current problem (using todays version)

Any update about this? Facing the same issue.

Hi. Just started using Xamarin Forms / Github - so I'm not confident in my understanding. My Android app has many labels, each with text that scrolls vertically - and teh scrolling works - but no vertical scrollbar appears - so the user doen't necessarily know there is more text to see. Am I understanding this thread right? The problem isn't because of something I'm doing wrong. There is in fact a bug that prevents vertcal scrollbars appearing in Android - for all Xamarin Forms views. And, looking at samhouts' link, there's no scheduled fix date yet. Is that right? Thanks for your help.

You are correct, I just ran into this aswell. It seems that the fix is included in Xamarin.Forms version 4.8, as mentioned in the issue linked above.

Thanks Alex. I don't know if you can help me understand how to get Xamarin.Forms v 4.8? I'm using Visual Studio v 16.7.3 with an option to upgrade to 16.7.6 - but I can't see anything about which version of Xamarin.Forms I am on, or what I would get if I upgraded? Thanks. Chris

Was this page helpful?
0 / 5 - 0 ratings