Android Custom scroll bar (ScrollBar) style

Source: Internet
Author: User

1. If your scrollbar is vertical, set the following properties

android:scrollbarThumbVertical="@drawable/scrollbar_indicator"android:scrollbarTrackVertical="@drawable/scrollbar_bg"

2. If your scrollbar is horizontal, set the following properties

android:scrollbarThumbHorizontal="@drawable/scrollbar_indicator"android:scrollbarTrackHorizontal="@drawable/scrollbar_bg"

Android:scrollbarthumbvertical and Android:scrollbarthumbhorizontal set a picture of the scroll bar indicator, which slides as it slides;

Android:scrollbartrackvertical and Android:scrollbartrackhorizontal set the scroll bar background.

It is important to note that:
A, the attribute must be a picture, can not directly set the color value;
b, the indicator will change the height according to the number of item, so it is recommended that the custom picture be made point nine (. 9)

Android Custom scroll bar (ScrollBar) style

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.