Search code examples
androidviewtranslate-animation

android translateAnimation


If I have two views, is it possible to create in a view a translate animation and even if the object moves outside his view, the view's height and width remain unchanged? I need to show moving object only inside his view.


Solution

  • View Animations on a view are always clipped to the parent view - it is common to translate by +/- 100% to ensure the view is moved completely out of the parent and works well without the view overdrawing any other aspect of the screen.