Can't make spinner's scrollbar always visible (Android)

后端 未结 6 1507
鱼传尺愫
鱼传尺愫 2020-12-10 16:55

I have such a problem - I want to make spinner\'s scrollbar always visible. But for spinner function

setScrollbarFadingEnabled(false);

caus

6条回答
  •  忘掉有多难
    2020-12-10 17:12

    After a initial investigation, I'm thinking that is not possible to call setScrollbarFadingEnabled(false); in a Spinner.

    I have read the implementation of the Class Spinner.java and View.java (this last one implements the setScrollbarFadingEnabled(boolean) of the API16 and the problem is the line:

    cache.scrollBar.setAlpha(255);
    

    Probably cache.scrollBar is null at this point and i didnt find any way to force some initialization of this attribute.

    The most methods who manage this attribute are protected or private, so we can't just call them.

    I'll continue to research this problem in order to find a possible solution, but for now, and considering that nobody have answered this question yet, i'm thinking that is not possible.

提交回复
热议问题