I have a fragment inside a RelativeLayout. This fragment contains a different imageView and trext over them .Everything works well except for one thing. If the screen space is too big like if i use screen like Nexus 10 or tablet it becomes flat , my xml code is given below, how could i balance same layout for all screen size with the change in xml file only ..
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/time"
android:textColor="#ffffff"
android:textSize="29sp" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/imageView1"
android:contentDescription="@string/active"
android:layout_marginRight="30dp"
android:src="@drawable/active" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignBottom="@+id/textView1"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/imageView2"
android:contentDescription="@string/wifi"
android:src="@drawable/wifi" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/imageView2"
android:background="#ff0000"
android:contentDescription="@string/search"
android:src="@drawable/search" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="230dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/imageView3"
android:layout_toLeftOf="@+id/imageView3"
android:layout_marginRight="10dp"
android:background="#64b5f6"
android:contentDescription="@string/weather"
android:src="@drawable/weather" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView4"
android:layout_alignLeft="@+id/imageView4"
android:layout_alignRight="@+id/imageView4"
android:layout_alignTop="@+id/imageView4"
android:text="@string/degree"
android:textColor="#ffffff"
android:textSize="30sp" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView4"
android:layout_marginTop="10dp"
android:background="#ff0000"
android:contentDescription="@string/calender"
android:src="@drawable/calend" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/imageView5"
android:layout_toRightOf="@+id/imageView5"
android:background="#64b5f6"
android:layout_marginLeft="10dp"
android:contentDescription="@string/player"
android:src="@drawable/wmp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView5"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:text="@string/agenda"
android:textColor="#ffffff"
android:textSize="30sp" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView5"
android:layout_alignLeft="@+id/imageView6"
android:layout_alignParentRight="true"
android:layout_below="@+id/imageView6"
android:layout_marginTop="10dp"
android:background="#ffb74d"
android:contentDescription="@string/gallary"
android:src="@drawable/pictures" />
</RelativeLayout>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.