2

How do I make a Layout that shows Multiple ImageViews with Different image-sources of different size, to appear perfectly on different screens i.e 5" or 5.2" or 3.7". I'm working on a Linear layout here is part of my layout file.

 <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/iv1"
                    android:layout_width="match_parent"
                    android:layout_height="270dp"
                    android:clickable="true"
                    android:src="@drawable/delhiie">
                </ImageView>

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="270dp"
                    android:src="@drawable/kolkatai"
                    android:id="@+id/iv2"
                    android:clickable="true">
                </ImageView>

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="270dp"
                    android:src="@drawable/mumbaii"
                    android:id="@+id/iv4"
                    android:clickable="true">
                </ImageView>

                <ImageView
                    android:id="@+id/iv3"
                    android:layout_width="match_parent"
                    android:layout_height="270dp"
                    android:clickable="true"
                    android:src="@drawable/chennaii">
                </ImageView>
            </LinearLayout>

And here is the preview for different Screens: for 5.2" for 3.7"

Difster
  • 3,264
  • 2
  • 22
  • 32
Mohd Zaid
  • 659
  • 6
  • 14
  • Check the documentation on this topic: https://developer.android.com/training/basics/supporting-devices/screens.html – dominicoder Aug 06 '17 at 16:20

0 Answers0