开发者

Dragging a ViewFlipper which containing a GridView, How to avoid miss-clicking on buttons?

开发者 https://www.devze.com 2023-02-19 08:28 出处:网络
Because I can not add the GridView into the ViewFlipper directly, I put the GridView in a FrameLayout and add the FrameLayout to the ViewFlipper instead.

Because I can not add the GridView into the ViewFlipper directly, I put the GridView in a FrameLayout and add the FrameLayout to the ViewFlipper instead.

Now the problem is that I can only drag on the empty parts of the FrameLayout to slide the ViewFlipper from side to side,开发者_如何学Go if I try to drag on the icons inside the GridView, will just invoke the clickListener.

Is there any way to avoid the clicking when dragging ,enable dragging on the whole FrameLayout, while the icons in the GridView should be still clickable?


However I found a solution myself. I just add a onTouchListener to the Gridview and pass the event to the gestureListener.

0

精彩评论

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

关注公众号