dimanche 24 mai 2015

Can't adjust ImageView on Android API below 16

I want to set a background image in my app, which will fill all screen and scale if needed, so I set it in my main_layout.xml like that:

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:adjustViewBounds="true"
    android:id="@+id/imageView"
    android:src="@drawable/bg_iphone_6_plus" />

and it looks like this api >= 16

not very good, I need this picture to adjust in width too, actually.

ok, so this works in most cases and with all API's higher 16, but when I run my app on api lower 16 ( minTargetSdk=14 ), I see this:

enter image description here

I have no idea why it shows like that, I have already tried this tutorial, and replaced ImageView with com.inthecheesefactory.thecheeselibrary.widget.AdjustableImageView

but it didn't change anything at all

Aucun commentaire:

Enregistrer un commentaire