开发者

Buttons on scrollview issue

This is my first question on StackOverflow, but I've learned a lot he开发者_如何学编程re already.

Now I have a problem, which I couldn't solve. I have a horizontal scroll view with some buttons on it (let's say 20 buttons). When I scroll and stop the scrollview, it needs some time to accept clicks by buttons. I mean - onClick method desn't fire.

It could be observed best when scrolling is fast, and stops rapidly because of coming to the end of scrollbar. Then it takes 2 clicks to get the button action.

I think this is some focus problem, or it's about of scrollview events implementation on scrolling.


As a ScrollView moves along, it unloads out-of-focus things and loads coming-into-focus things. This may be why the button's click takes a bit to register.

A project of mine learned this the hard way after we had already implemented everything in it. It worked great before the ScrollView had large amounts of content. Then once it did, it was super laggy and that's when we learned this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜