Move a picture anywhere on the touch screen by tapping and dragging, with touch events in Android.
Create new project with Application name: Move Image; Minimum SDK: API 27 – Android 8.1 (Oreo).
Add a picture (picture.png) in res->drawable folder.
In app->res->layout->activity_main.xml write the code:
1: Go to Desingn
click on your image that will appear.
your image has 4 balls
in these four balls the left and the top are with arrows pointing to their respective function
now do the same with the one on the right and the one below
select the circle and pull it to the end of the edge of the screen it is on, this way it will be the same as the previous two
when you do that the ball will turn blue.
make sure the four balls are blue and pointing to their respective position
if there is no blue but it is pointing, select the circle again and pull to the edge corner
Hello Sir good afternoon!
I need your help. I want image size should not decrease, when I reached to the corner of screen.
I hope I’m not late.
follow the example
1: Go to Desingn
click on your image that will appear.
your image has 4 balls
in these four balls the left and the top are with arrows pointing to their respective function
now do the same with the one on the right and the one below
select the circle and pull it to the end of the edge of the screen it is on, this way it will be the same as the previous two
when you do that the ball will turn blue.
make sure the four balls are blue and pointing to their respective position
if there is no blue but it is pointing, select the circle again and pull to the edge corner
do not let go of the edge or it will not work.
success.
O Brasil é brilhante!!!
Pinch to resize image
Hi, would you know how to move picture where I am pressing on the screen without touching it previously?