Android Studio image shown in Design screen but not in emulator -


an image use (.jpg) in android project shown in "design" when start emulator, not there. other images not loaded.

i found possible solutions image showing in android studio not on phone none of solutions worked in case. sum up, tried:

  • moving image drawable-xxhdpi or mipmap--xxhdpi
  • using other image , different format (.png)
  • adding android:adjustviewbounds="true"
  • clean/rebuild project etc

no success. work on os x

code:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" >  <linearlayout     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@android:color/background_light">      <imageview         android:layout_width="match_parent"         android:layout_height="wrap_content"         app:srccompat="@drawable/testimage"         android:id="@+id/imageview"         />      <textview         android:text="test"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:id="@+id/textview2"         android:textalignment="center" />  </linearlayout> </relativelayout> 


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -