81

How can I get rid of the scrollbars on a HorizontalScrollView?

blahdiblah
  • 32,000
  • 21
  • 97
  • 150
Ostkontentitan
  • 6,758
  • 5
  • 52
  • 71

1 Answers1

257

Add the following to your xml:

android:scrollbars="none"

Or hide the scrollbars programmatically:

view.setVerticalScrollBarEnabled(false); 
view.setHorizontalScrollBarEnabled(false);
Benito Bertoli
  • 24,408
  • 12
  • 53
  • 61
  • 8
    it seems there is a bug that ignores android:scrollbars="none" on many devices so programmatic approach is the right way. thanks :-) – Dragan Marjanović Feb 21 '13 at 10:33
  • Actually is not a bug, it depends if you are placing the xml code correctly. :) – Machado Nov 07 '14 at 03:26
  • 4
    @Machado what is the correct way then? Putting android:scrollbars="none" on the HorizontalScrollView element has no effect. – James May 21 '15 at 04:46
  • 1
    as mentioned by @Benito, do it programmatically. XML method failed for me at places, while through code it worked at all times. – Tanishq Sharma Dec 28 '16 at 13:13