Gilles
Gilles

Reputation: 29

Android ImageView doesn't show background image as mipmap

First of all, the ImageView shows well in the Resource Design panes of Android Studio !

Here is part of the Activity onCreate code :

    logo = (ImageView) findViewById(R.id.iconView);
    logo.setImageResource(R.mipmap.a6icon);

and here is part of the activity xml file

<ImageView
    android:id="@+id/iconView"
    android:background="@mipmap/a6icon"
    android:layout_width="100dp"
    android:layout_height="95dp"
    android:layout_alignParentStart="false"
    android:layout_alignParentLeft="false"
    android:layout_alignParentTop="false"
    android:layout_alignParentEnd="false"
    android:layout_alignParentRight="false"
    android:layout_alignParentBottom="true"
    android:layout_centerInParent="true"
    android:layout_gravity="center_horizontal|bottom"
    android:layout_marginBottom="35dp"
    android:baselineAlignBottom="false"
    android:clickable="false"
    android:contentDescription="@string/a6_logo"
    android:longClickable="false" />

Upvotes: 0

Views: 15

Answers (0)

Related Questions