android - Image displays in design view, but doesn't show up in emulator or on the phone -


displaying image on android:

image displays fine in design view of eclipse, doesn't show in emulator or on phone. here layout snippet:

<imageview     android:id="@+id/imageview1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/yyy"     android:layout_below="@+id/textxxx"     android:layout_centerhorizontal="true"     android:layout_marginbottom="10dp"     android:layout_margintop="10dp"     android:contentdescription="trouble"     android:ems="10"     android:src="@drawable/xxx_yyy"     android:visibility="visible"     android:scaletype="fitcenter"/> 

ideally, situation should not happen. if happening can re-check these lines :

  1. enable layout boundaries : if device developer mode enabled settings -> developer options -> show layout boundary

    else go settings -> phone -> click 5 times on baseband version , device developer mode enabled , execute above step

    using this, layout display boundary lines on edges. if layout being hidden on device or emulator other large layouts can check easily. if boundaries not visible, layout not on foreground now, need check other overlapping layouts

  2. you can set background color of layout , outside part of layout. i.e. layout has background green (00ff00) , outside part has background red (ff0000). helps identify our layout is.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -