How to add a scrollbar to a custom SurfaceView of a virtual height
I have a SurfaceView which has a fixed height within the game (let's say it is always 400 pixels high). However, the content that I display within that SurfaceView is tile-based, so at any point within the game, the content can have a "virtual" height of any value, 400 or more pixels. When the content height is larger than the SurfaceView height, the user can scroll that content up and down. When that happens, I would like to add a standard scrollbar to indicate where the user is scrolling currently within that content.
How is it possible to add the standard scrollbar and change its le开发者_如何学JAVAngth (height in this case) depending on the height of my "virtual" content? Thank you!
精彩评论