i have a background image which should be scaled on the height, but keep its aspect ratio. i tried it whith this code:
<ImageView
android:id="@+id/iv_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/bg" />
this works on phones in potrait mode, but when i test it on a tablet (default landscape), it scales the width and cuts the image on top and bottom. is this because of the xml code or because of the landscape?
0 comments:
Post a Comment