简体   繁体   中英

I want to use swipe technique to implement unlocking in my app.

|                      |
| -------drag--------> | 
|                      |

when user click button and drag it across the screen the button/image should move with touch horizontally. I'm newbie. Please help me out.

该示例可能会为您提供帮助。.http ://www.vogella.com/articles/AndroidDragAndDrop/article.html

Hmm. Your question falls into two basic sub-questions:
1) How do I deal with touch events? and
2) How do I move stuff around the place?

I think you're going to need to start with some basic examples of both and then wire them up together. Until you understand both aspects you're unlikely to get very far.

Here's a good tutorial which combines elements of both: http://eleanordarephdjournal.blogspot.co.uk/2011/03/example-of-simple-animation-and-touch.html , once you can understand what is going on in here, you'll know what to search for to find out more!

Happy hunting!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM