1

I have a listView in which in each row I have a structure as following :enter image description here When I am trying by margin my image is getting back to relative layout.What is the way of achieving this type structure.Should I use any other layout ? what is the efficient way for such kind structure?

Anshul
  • 9,312
  • 11
  • 57
  • 74

1 Answers1

2

Try with this:

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent"
android:layout_height="100dip"
android:background="@android:color/white" >

   <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="90dip"
    android:layout_marginTop="10dip"
    android:background="@android:color/black" >

   </RelativeLayout>

   <ImageView
    android:layout_width="30dip"
    android:layout_height="30dip"
    android:background="@drawable/ic_launcher"
    android:layout_marginLeft="10dip" >

</ImageView> 
</RelativeLayout>

Dimension and drawable are relative to my project but the idea is the same.

phemt.latd
  • 1,775
  • 21
  • 33