Monday, 2 February 2015

Android: how to make image wider than screen



I want to create rotate animation of ImageView in Android. Because image is a square, so I need to make its width larger than screen width. Fixed size doesn't work. When I start playing with different scale type, I get a square which width is exactly the same as the device's width or I get the rectangle (height is the same as device's height, but the width is cropped, so animation doesn't work as I want). Is it possible to set bigger width? Thanks!



<ImageView
android:layout_width="2000dp"
android:layout_height="2000dp"
android:src="@drawable/stars"
android:id="@+id/stars"
android:layout_centerInParent="true"/>

No comments:

Post a Comment