开发者

Android Swipe Finger

开发者 https://www.devze.com 2023-03-22 17:14 出处:网络
Please look at this picture Basically you swipe your finger down in that area a开发者_如何学Pythonnd it shows more.. how can i do this?With ViewFlipper or (horizontal)ListView , each page/item of t

Please look at this picture

Android Swipe Finger

Basically you swipe your finger down in that area a开发者_如何学Pythonnd it shows more.. how can i do this?


With ViewFlipper or (horizontal)ListView , each page/item of the ViewFlipper/ListView will contain one of these view (I bet they are images). For swiping you can implement``onTouchListener or GestureDetector. Override onFling() method, and measure the distance between the initial X-coordinate when the user touches the screen and the final x-coordinate when the user releases the touch screen with method event1.getX() and event2.getX(). Do not measure the motion on the y-axis since --->(to right, you have motion only on the x-axis). Intialize some MINIMUM_DISTANCE to compare with the result from difference between the first touch and release touch coordinate (event1.getX() - event2.getX()).

0

精彩评论

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