I am trying to get my xml for my android app working but i have some problems. I am trying to display to equal sized images side by side in a linear layout. There has to be a margin between them , on both sides right and left, and on top.
How can I make such an xml file so that it is universal and usable for any screen size?
UPDATE: Here is my the extract of my xml file:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:src="@drawable/area_selector"
android:layout_gravity="left"
android:paddingTop="15dp"/>
<ImageView
android:id="@+id/volume"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:src="@drawable/volume_selector"
android:layout_gravity="left"
android:paddingTop="15dp" />
</LinearLayout>
You need to provide equal weights to both the images as follows
In your case use this