I'm trying to make an image move completely off of the screen in an Android app. I already have the code that allows it to move across the screen, but it stops at the side, and it can't go outside of the screen. Is there any way to make it so it can go off of the screen?
Asked
Active
Viewed 301 times
1
-
Remove it from the view? Make it invisible? – Joseph Boyle Jul 20 '14 at 20:44
-
possible duplicate of [Show and hide a View with a slide up/down animation](http://stackoverflow.com/questions/19765938/show-and-hide-a-view-with-a-slide-up-down-animation) – Xaver Kapeller Jul 20 '14 at 20:45
1 Answers
1
You can use scrollview for this. Set maximum width/height you want. It means whether you want to move view horizontally/vertically. Then you can apply possible animations using setX()/setY() method. This way, you can move view off the screen & by changing X/Y position you can get it back on the screen.
I just tried it using setX/setY method.

VVB
- 7,363
- 7
- 49
- 83