IDは同じ回転仕様を使用して、すべて同時に一度にビューを回転させるのが好きです。問題は、何らかの理由で、回転が2番目の要素に対して異なる動作をするということです。どうやらこれはアニメーションオブジェクトが2つのコード行の間で実際に状態を変えることと関係しています。複数のビューに同時に1つのアニメーションを適用する
Animation rotateAnim = AnimationUtils.loadAnimation(this, R.anim.rotationtoportrait);
target.startAnimation(rotateAnim);
lightBtn.startAnimation(rotateAnim);
は両方とも正常に回転します:もちろん、私はちょうど
が正しくのみ最初のビューを回転(私は約15見解を持っている)別々のアニメーションオブジェクトを作成し、それを適用されますが、もっと簡単な方法があるように私は感じることができました
Animation rotateAnim = AnimationUtils.loadAnimation(this, R.anim.rotationtoportrait);
Animation rotateAnim2 = AnimationUtils.loadAnimation(this, R.anim.rotationtoportrait);
target.startAnimation(rotateAnim);
lightBtn.startAnimation(rotateAnim2);
XML:
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="-90"
android:toDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="500" android:fillAfter="true">
Aどんなアイディアがありますか?
てみてください。また、私はこれを見ることをお勧めします:http://www.youtube.com/watch?v=_UWXqFBF86U – Leandros
ビデオを愛する!しかし、私がこれまでに言うことができる新しいAPIは、動画に登場する人物が何をしていたのだろうか?(少なくとも最後に) – Jameo
間違ったビデオ、申し訳ありません。 ;)http://www.youtube.com/watch?v=3UbJhmkeSig – Leandros