In an Android ListView
, how can I make the scrollbar
appear on the left side?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
example:
As the other two answers have mentioned, one possibility is using View.setVerticalScrollbarPosition() with SCROLLBAR_POSITION_LEFT. However, one giant caveat is that this requires API level 11+, which at time of writing accounts for fewer than 10% of Android installations. For most applications, that's not acceptable.
One possibility that comes to mind to accomplish what you want on older versions of Android would be to do something very kludgy: turn off the scroll bar, mirror your main layout with a narrow layout to the left of it, just wide enough to fit a scroll bar, and manually scroll the left view with scrollyBy() as your main view is scrolled (by overriding onScrollChanged()).
That said, I wouldn't actually recommend that unless there's a very compelling reason to move the scroll bar to the left. In most cases, you want your app to fit in and behave like any other app on the device by just letting Android follow its defaults.
You can move the scrollbar position to the left for any View using View.SCROLLBAR_POSITION_LEFT.
Try my hack, seems to work at least on 2.2 and above.