Shared publicly  - 
 
#AndroidDev #ProTipYou can decide how the View class draws scrollbars using android:scrollbarStyle [0] or setScrollBarStyle(int) [1]. By default, a View draws scrollbars using the insideOverlay style which basically means the scrollbars will be drawn on top of your content without increasing the padding. In some cases it might be useful not to take into account the padding. A good example of this is the Settings application where ListViews include padding but scrollbars are drawn at the edge of the View. In order to do that, just use android:scrollbarStyle="outsideOverlay".

For your information, View also supports the "inset" counterparts. These styles increase the padding depending on the scrollbar width/height.

[0]: http://developer.android.com/reference/android/view/View.html#attr_android:scrollbarStyle
[1]: http://developer.android.com/reference/android/view/View.html#setScrollBarStyle(int)
22
5
Fernando F. Gallego's profile photo
 
If you have a match_parent webview the scrollbars are by default outsideOverlay and this causes a white line on the right side of the webview. So setting it to insideOverlay avoids this problem and also looks nicer 


mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
Add a comment...