Autohide scrollbars when not scrolling in a ListView

前端 未结 4 450
广开言路
广开言路 2021-01-12 09:01

In the new official Twitter app, the scrollbars in all the ListViews the app uses are hidden unless the user is scrolling through the list.

When you start scrollin

4条回答
  •  春和景丽
    2021-01-12 09:30

    You can enable scroll bar fading for your entire app on API level 5 and newer via a custom theme and the fadeScrollbars style attribute by adding this to styles.xml:

     
    

    Then set the new theme for your application in AndroidManifest.xml:

     
    

    Just be sure you're not overriding this global theme on individual activities. Earlier Android versions will safely ignore this unknown XML attribute and not fade the scrollbars.

提交回复
热议问题