Remove scroll bar track from ScrollView in Android

后端 未结 6 995
被撕碎了的回忆
被撕碎了的回忆 2020-12-23 15:34

My Android app has a main WebView (HTML loaded from a local resource) which I want to use the entire width of the screen and be able to make (vertically) scrollable. So I\'v

相关标签:
6条回答
  • 2020-12-23 16:08

    try this is your activity onCreate:

    ScrollView sView = (ScrollView)findViewById(R.id.deal_web_view_holder);
    // Hide the Scollbar
    sView.setVerticalScrollBarEnabled(false);
    sView.setHorizontalScrollBarEnabled(false);
    

    http://developer.android.com/reference/android/view/View.html#setVerticalScrollBarEnabled%28boolean%29

    0 讨论(0)
  • 2020-12-23 16:09

    By using below, solved the problem

    android:scrollbarThumbVertical="@null"
    
    0 讨论(0)
  • 2020-12-23 16:14

    To remove a scrollbar from a view (and its subclass) via xml:

    android:scrollbars="none"
    

    http://developer.android.com/reference/android/view/View.html#attr_android:scrollbars

    0 讨论(0)
  • 2020-12-23 16:20

    I'm a little confused why you are putting a WebView into a ScrollView in the first place. A WebView has it's own built-in scrolling system.

    Regarding your actual question, if you want the Scrollbar to show up on top, you can use

    view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY) or   
    android:scrollbarStyle="insideOverlay"
    
    0 讨论(0)
  • 2020-12-23 16:23

    Solved my problem by adding this to my ListView:

    android:scrollbars="none"
    
    0 讨论(0)
  • 2020-12-23 16:24

    These solutions Failed in my case with Relative Layout and If KeyBoard is Open android:scrollbars="none" & android:scrollbarStyle="insideOverlay" also not working.

    toolbar is gone, my done button is gone.

    This one is Working for me

    myScrollView.setVerticalScrollBarEnabled(false);
    
    0 讨论(0)
提交回复
热议问题