0

In my layout all content(text and images) load through server.when application run on both hdpi and xxhdpi bottom layout components are not showing.

HDPI Screenshot

HDPI

XXHDPI Screenshot

xxhdpi

Is there any way to make layout to suitable for all device category?

bellow is my layout code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:textAlignment="gravity" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="40dp"
    android:background="#ffebd5ca"
    android:gravity="center"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_weight="0.4"
        android:background="#ffebd5ca"
        android:gravity="center"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|center_horizontal"
            android:src="@drawable/titlelogo" />
    </LinearLayout>
</LinearLayout>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#ffebd5ca"
    android:orientation="horizontal"
    android:paddingLeft="8dp"
    android:paddingRight="8dp" >

    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >

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



            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

            </FrameLayout>

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:layout_alignParentBottom="true"
                android:background="#ffebd5ca"
                android:showDividers="none"
                android:tabStripEnabled="true"
                android:tabStripLeft="@drawable/btnline2"
                android:tabStripRight="@drawable/btnline2"
                android:textAlignment="viewEnd"
                android:layout_marginBottom="-4dp"
                android:gravity="bottom" >



            </TabWidget>
        </LinearLayout>
    </TabHost>

</LinearLayout>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="0.3"
    android:background="#ffebd5ca"
    android:orientation="vertical"
    android:paddingBottom="8dp"
    android:paddingLeft="8dp"
    android:paddingRight="8dp" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#ff5a3e30" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="vertical"
            android:padding="8dp" >

            <LinearLayout
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:layout_gravity="center"
                android:background="@drawable/logo_border"
                android:gravity="center" >

                <ImageView
                    android:id="@+id/mLogoAdView"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_centerInParent="true" />

            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:gravity="left|center_vertical"
            android:orientation="vertical"
            android:paddingLeft="10dp" >

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

                <TextView
                    android:id="@+id/txtCompany"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="SAMSUNG PVT LTD."
                    android:textColor="@color/tabhost_text_select"
                    android:textSize="12dp" />

                <TextView
                    android:id="@+id/txtAddressLine1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="No 124, Main Street, Colombo 07"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textColor="#ffd3bdb2"
                    android:textSize="10dp" />

                <TextView
                    android:id="@+id/txtTelephone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:text="T.P       :      011-2345678"
                    android:textColor="@color/tabhost_text_select"
                    android:textSize="10dp" />

                <TextView
                    android:id="@+id/txtMobile"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Mobile :      011-2345678"
                    android:textColor="@color/tabhost_text_select"
                    android:textSize="10dp" />
            </LinearLayout>

        </LinearLayout>
    </LinearLayout>
</LinearLayout>

Suravi
  • 301
  • 1
  • 7
  • 21

1 Answers1

0

7-inch tab

Create the folder name -values-sw600dp(under res folder)

1.under values-sw600dp->create dimen.xml

10-inch tab

Create the folder name -values-sw720dp(under res folder)

1.under values-sw720dp->create dimen.xml

Using dp values in 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and xxx-high respectively);

values->dimens.xml

<dimen name="five_dp">5dp</dimen>

values-sw600dp->dimens.xml

<dimen name="five_dp">10dp</dimen>

values-sw600dp->dimens.xml

<dimen name="five_dp">15dp</dimen>