0

I have a custom grid view for each and every grid I am using

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<View
    android:layout_width="fill_parent"
    android:layout_height="30sp"
    android:layout_marginTop="85sp"
    android:background="@drawable/shelf" />

<ImageView
    android:id="@+id/imgThumb"
    android:layout_width="47.5sp"
    android:layout_height="76sp"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="29sp"
    android:background="@drawable/pic1" />

<ImageView
    android:id="@+id/bookCover"
    android:layout_width="60sp"
    android:layout_height="80sp"
    android:layout_marginLeft="127sp"
    android:layout_marginTop="26sp"
    android:background="@drawable/book_cover" />

which looks like this before Graphical layout in eclipse enter image description here

but when I am running this on emulator it looks like enter image description here

Book cover image is gone I am new in android please don't where is the problem and how to solve it

A J
  • 4,542
  • 5
  • 50
  • 80
  • Graphical layout is still not that mature. You might let us know what you want to achieve. – Avinazz Mar 30 '13 at 08:35
  • refer this...http://stackoverflow.com/questions/10953368/android-display-image-over-an-image-in-imageview – karan Mar 30 '13 at 08:40

2 Answers2

1

you can use the frame layout for this purpose...

<FrameLayout android:layout_width="wrap_content" 
             android:layout_height="wrap_content">
   <ImageView  android:src="@drawable/yourimage1"/>
   <ImageView  android:src="@drawable/yourimage2" 
               android:layout_gravity="bottom|right" />
</FrameLayout>

do not forget to set the height and width as per your convenience you can also pad them...

Rahul Gautam
  • 4,749
  • 2
  • 21
  • 30
karan
  • 8,637
  • 3
  • 41
  • 78
0

Try using same xml file using Framelayout insted of RelativeLayout....

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
Umesh Lakhani
  • 2,382
  • 1
  • 14
  • 10