开发者

Bi-directional ScrollView

开发者 https://www.devze.com 2023-03-11 14:09 出处:网络
I\'m curious if anyone has run into the s开发者_如何学编程ame problem as me. I have an image that I can manipulate with pinch zooming. I\'d like to be able to scroll horizontally and vertically when t

I'm curious if anyone has run into the s开发者_如何学编程ame problem as me. I have an image that I can manipulate with pinch zooming. I'd like to be able to scroll horizontally and vertically when the image is too large for the screen. I've accomplished this with a ScrollView and HorizontalScrollView combo. But this implementation leads to clunky behavior. Has anyone solved a similar problem?


I think you will have to implement a custom component that allows scrolling in both directions, as it appears ScrollView only supports vertical scrolling. You should review the Android documentation for the Scroller class, found here. I cannot recommend against multiple scrollviews enough. This will almost always result in "clunky" unexpected behavior.


I wrote my own class for this. There is no already built solution. If you've already written pinch zooming, scrolling should be much easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号