Android rotation animation with ScrollView

I am trying to animate a custom scroll view that I changed using LayoutParams (height and width).

Something like that:

 ObjectAnimator rotation = ObjectAnimator.ofFloat(view, "rotation", rotationValue); rotation.start(); 

Animation runs fine, but all ScrollView content is drawn within the rotation of the rotation. Images are attached.

Is anyone Thanks.

to: http://i.stack.imgur.com/TIxZL.png

after: http://i.stack.imgur.com/EWTAG.png

+6
source share
1 answer

I suspect your problem is that you need to set the android:clipChildren in the parent ViewGroup .

Quoting ViewGroup documentation for android:clipChildren :

Determines whether the child is limited to drawing within its borders or not. This is useful for animations that scale the size of children to over 100%, for example. In this case, this property should be set to false so that children can draw outside their borders. The default value of this property is true.

So, add android:clipChildren="false" to the XML layout or call the ViewGroup method setClipChildren if you programmatically create an interface.

0
source

Source: https://habr.com/ru/post/946278/


All Articles