Always show spinner Scrollbar in dialog mode

PhinehasPhinehas Member ✭✭
edited June 2018 in Xamarin.Android

Hi,

I have a long list and would like to show as dropdownlist for user to select. Therefore, I use spinner to show the list. However, I find that I fail to set the scrollbar always visible. Even I set the fadeScrollbars to false and delay 600000 before fade out scrollbars, it also auto fade out within 5s.

android:fadeScrollbars="false" android:scrollIndicators="right" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbarDefaultDelayBeforeFade="600000" android:scrollbars="vertical" android:spinnerMode="dialog"

If I try to set the mPopup field, it throws null when getting the spinner.
try { Java.Lang.Reflect.Field mPopup = ddlDescList.Class.GetDeclaredField("mPopup"); mPopup.Accessible = true; ((ListPopupWindow)mPopup.Get(ddlDescList)).ListView.ScrollbarFadingEnabled = false; } catch (Exception ex) { }
Is there any method to force the scrollbar always visible for user?

Thanks
Phc

Answers

  • MizanurRahman.0834MizanurRahman.0834 USMember ✭✭

    Scroll bar should appears automatically. If it does not enabled then you can use following lines of code


    android:fadeScrollbars="false"
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:scrollbarFadeDuration="50000"


    android:scrollbarSize="4dp"

    !--Either you can use Scroll Bar Color or not-->
    android:scrollbarThumbVertical="@color/colorPrimary"

    Hope it will help.

  • PhinehasPhinehas Member ✭✭

    I'm using Android Emulator to test the spinner dialog mode.
    But the setting does not work. The scrollbar still disappear after several second. And the scrollbarSize also does not work.

  • PhinehasPhinehas Member ✭✭

    I'm using Android Emulator to test the spinner dialog mode.
    But the setting does not work. The scrollbar still disappear after several second. And the scrollbarSize also does not work.

Sign In or Register to comment.