Display image in Android Studio but not on the phone

As you can see below, this shows Android Studio:

enter image description here

However, when I run this application on my phone, viewing the list shows only a blank image (ie a space) above it, where it should be "somewhere above the rainbow."

View mode works great. It consists of one image and two textual representations. (This representation of the image works if it helps). If any of this possibly interferes, I will post the code here, but it's hard for me to believe.

The only thing I did not know about was to use the relative view when defining the cells to represent the list in a separate XML file. I don’t understand why not, but this is the only thing I could think of.

Android- , , / . , .

Android, .

.png . .png , , , . ? , Android Studio

"mipmap-xxhdpi" -

+5
8

​​ . . i.e 1280 x 840, drawable-xxhdpi.

+11

: (: fooobar.com/questions/378674/...)

, , - ( Drag/Drop ImageView) app:srcCompat="@drawable/logo" android:src="@drawable/logo" "", , ,

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/logo"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="75dp"
    android:id="@+id/logoImageView"
    android:scaleType="fitXY"
    android:scaleX="1.5"
    android:scaleY="1.5" />
+22

, , . , , drawable-nodpi

, , ?

HTC One M8

.

+3

, HDPI Samsung Galaxy S4 .

, HDPI . drawable-xxhdpi drawable-(whateverxxxhdpi), [path to your project folder]\app\src\main\res\, , .

+2

( , , ) , , drawable-hdpi . -, (-hdpi, -mdpi, -ldpi) .

mipmap ( , , android:src="@drawable/image" android:src="@mipmap/image"), Android , mipmap " ". , , mipmap, , , Android.

, , /, , . " Android" " " , , Android , , .

, Android , , :

/
  -/
  --/
  --/
  --NoTouch-12key/
  --ldpi/
  drawable-port-notouch-12key/

, :

= en-GB
   =
   = hdpi
   = notouch
   = 12key

, Android drawable-en-port.

/, , "" , .

+1

if you use android:srcor app:srcCompatinstead android:background:

android:background="@drawable/your_image"
+1
source

I had this problem and solved it by adding this to my imageView xml code

android:adjustViewBounds="true"
0
source

I had a similar problem. my image was displayed on the image but not displayed on my android device ...

I changed

tools:srcCompat="@drawable/ic_wifi"

and replaced it

app:srcCompat="@drawable/ic_wifi"
0
source

All Articles