Animation in a single file
I have the following animation for a button, for another button I need to a change few parameters. How do I do that in the same xml file. The f开发者_开发问答ollowing code is present in res/anim directory
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="300%" android:toXDelta="0%" android:fromYDelta="300%"
android:toYDelta="0%" android:duration="1000" android:zAdjustment="bottom" />
The best solution although cumbersome at first is to make each animation separate, in its own file. It may feel like duplicate code but after a while you will see that when you're changing settings in different place just to get the right effect then you'll be glad you didn't tie the two widget animations together.
精彩评论