I want to display an image like this, like in stack on top of each other, How I can achieve this type of design dynamically
Please use this code:-
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:layout_width="120dp" android:layout_height="120dp" android:contentDescription="@string/app_name" android:src="@drawable/image_1" /> <ImageView android:layout_width="120dp" android:layout_height="120dp" android:layout_marginStart="-50dp" android:contentDescription="@string/app_name" android:src="@drawable/image_2" /> <ImageView android:layout_width="120dp" android:layout_height="120dp" android:layout_marginStart="-50dp" android:contentDescription="@string/app_name" android:src="@drawable/image_3" /> <ImageView android:layout_width="120dp" android:layout_height="120dp" android:layout_marginStart="-50dp" android:contentDescription="@string/app_name" android:src="@drawable/image_4" /> </LinearLayout>
set leftmargin to -16dp for example or 1/4 of width of your images
Please use this code:-