Remove the scroll bar from the HorizontalScrollView of the Android control.
By default, the content in the HorizontalScrollView control is scroll, and a scroll bar appears. To remove the scroll bar, you only need to add an android in <HorizontalScrollView/>: scrollbars = "none ".
If you want to implement this in the code, click the left (right) button [btnLeft (btnRight)], and the content in the scroll bar will scroll to the left to the right [horizontalScrollViewMM ]. The Code is as follows:
Scroll to the left of the scroll bar:
btnLeft.setOnClickListener( new View.onClickListener(){ horizontalScrollViewMM.arrowScroll(View.FOCUS_LEFT); });
Scroll to the right of the scroll bar:
btnRight.setOnClickListener( new View.onClickListener(){ horizontalScrollViewMM.arrowScroll(View.FOCUS_RIGHT); });
How can I control the scroll bar of Android HorizontalScrollView in JAVA code?
SV. setHorizontalScrollBarEnabled (false );
Question about the horizontal scroll bar of android scrollview
If you include the content in the ScrollView, the scroll bar will automatically appear when the content exceeds the height.
In addition, when you use the control HorizontalScrollView to wrap your content,
If your content is assumed to be a LinearLayout, when the width of LinearLayout exceeds the screen, a scroll bar is automatically generated. When you drag the mouse, the effect is the same as that of scrollView.
Example:
Vertical scroll
<ScrollView>
<LinearLayout...>
<TextView.../>
<TextView.../>
<TextView.../>
<TextView.../>
</LineraLayout>
</ScrollView>
Die-Rolling
<HorizontalScrollView>
<LinearLayout...>
<TextView.../>
<TextView.../>
<TextView.../>
<TextView.../>
</LineraLayout>
</HorizontalScrollView>
Sometimes it can even be horizontally and vertically supported. You only need to design it properly. Note that only one control can be added to the ScrollView, and no more than two