Android 设置动画时,将剪切比屏幕大的图像
我需要旋转一个比屏幕大的轮子图像(这是必须的) 问题在于android:scaleType=“center”必须显示比屏幕大的图像,而不进行缩放,旋转时,这个标签会裁剪图像(参见下面的屏幕截图) 以下是我的布局代码:Android 设置动画时,将剪切比屏幕大的图像,android,rotation,scale,android-imageview,android-animation,Android,Rotation,Scale,Android Imageview,Android Animation,我需要旋转一个比屏幕大的轮子图像(这是必须的) 问题在于android:scaleType=“center”必须显示比屏幕大的图像,而不进行缩放,旋转时,这个标签会裁剪图像(参见下面的屏幕截图) 以下是我的布局代码: <ImageView android:id="@+id/wheel_img" android:scaleType="center" android:layout_width="wrap_content" android:layout_hei
<ImageView
android:id="@+id/wheel_img"
android:scaleType="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/wheel_test" />
以及anim/rotation.xml
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromDegrees="0"
android:toDegrees="30"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="true"
android:duration="2000" />
你知道怎么解决这个问题吗?这其实很紧急
提前谢谢 这就是我使用的技巧 使用框架布局
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/wheel_image"
android:layout_width="image width"
android:layout_height="image height"
android:src="@drawable/wheel_test"
android:layout_gravity="center" />
工作起来很有魅力
这是我在这里的第一个贡献。希望它能与您一起工作将您的视图添加到滚动视图中就可以了
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" >
<ImageView
android:id="@+id/iv_light_streak"
android:layout_width="500dp"
android:layout_height="500dp"
android:layout_gravity="center"
android:scaleType="centerInside"
android:src="@drawable/wheel_test" />
</LinearLayout>
</ScrollView>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" >
<ImageView
android:id="@+id/iv_light_streak"
android:layout_width="500dp"
android:layout_height="500dp"
android:layout_gravity="center"
android:scaleType="centerInside"
android:src="@drawable/wheel_test" />
</LinearLayout>
</ScrollView>