我为对话框创建了自定义输入动画:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000" />
对话框应该围绕它的中心旋转......但它没有。它围绕其他点旋转。这里有什么问题?
--- 编辑:附加更多代码 ---
对话框创建:
Dialog dialog = new Dialog(SampleActivity.this, R.style.DialogStyle);
dialog.setContentView(R.layout.test_layout);
dialog.show();
样式.xml:
<style name="DialogStyle" parent="android:Theme.Dialog">
<item name="android:windowAnimationStyle">@style/DialogAnimation</item>
</style>
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/dialog_enter</item>
</style>
test_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="270dip"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Random text\nRandom text\nRandom text" />
</LinearLayout>