I have a listView in which in each row I have a structure as following : 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?
Asked
Active
Viewed 38 times
1

Anshul
- 9,312
- 11
- 57
- 74
-
1Take parent relative layout and inside that use above imageview and relative layout – Sonali8890 Feb 07 '14 at 08:10
-
@sonali8890 How can I put a image view on top of a layout ? – Anshul Feb 07 '14 at 08:13
-
show us your xml code – alecnash Feb 07 '14 at 08:25
1 Answers
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