1

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?

David Elliott
  • 113
  • 1
  • 3
  • 10

1 Answers1

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