"<" string in xml file - android

I could not build my project in the android studio.
the problem was ":app:mergeDebugResources" Error,
after a while I found this error is caused by android:text"<"
attribute in the XML file.after changing "<" character, the problem was solved.
Is there any meaning for "<" String_character in XML language?
The XML file is : (black lines of the code)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:orientation="vertical">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.18"
android:orientation="horizontal">
<Button
android:id="#+id/btn_clearEntity"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="CE"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_clear"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="C"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_delete"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="<"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_division"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="/"
android:textColor="#000000"
android:textSize="20dip" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.18"
android:orientation="horizontal">
<Button
android:id="#+id/btn_7"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="7"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_8"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="8"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_9"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="9"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_multiplication"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="X"
android:textColor="#000000"
android:textSize="20dip" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.18">
<Button
android:id="#+id/btn_4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="4"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_5"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:baselineAligned="false"
android:text="5"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_6"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="6"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_minus"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="-"
android:textColor="#000000"
android:textSize="20dip" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.18"
android:orientation="horizontal">
<Button
android:id="#+id/btn_1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="1"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="2"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="3"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_plus"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="+"
android:textColor="#000000"
android:textSize="20dip" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.18"
android:orientation="horizontal">
<Button
android:id="#+id/btn_sign"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="-/+"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_0"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="0"
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_point"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="."
android:textColor="#000000"
android:textSize="20dip" />
<Button
android:id="#+id/btn_equal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:text="="
android:textColor="#000000"
android:textSize="20dip" />
</LinearLayout>
</LinearLayout>
and:
[[image of error]

I am assuming that you are wondering how to get a < or a > in the text of a view.
For a less than <
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<"/>
For a greater than >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">"/>
https://www.w3schools.com/html/html_entities.asp

Related

ScrollView laggs too much on scrolling android

i am using scrollview in Linearlayout , the problem is layout respond normally, as soon as i start scrolling, it laggs too much.
< LinearLayout >
< ScrollView >
< Linearlayout >..sub (LinearLayout)..< /LinearLayout >
< ScrollView>
< LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="vertical"
android:background="#drawable/round_edittext"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/proile_activity_unique_key_linearlayout_id"
>
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="20sp"
android:orientation="horizontal"
>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
>
</Spinner>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
i have used this code for my Linearlayout, As soon as i touch radioButton or edittext or i scrolldown, It start lagging alot. Im not able to understand the problem, the images i have used are small size below 100kb
I edited your code and took out about 4 LinearLayouts which were unnecessary. Please test it for performance. If it still is slow try substituting some of the remaining vertical LinearLayouts with RelativeLayouts as #IshitaShinha suggested.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/round_edittext"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/proile_activity_unique_key_linearlayout_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
android:layout_marginTop="20sp" />
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</ScrollView>

How to align textviews regarding to the layout background

I would like to know if there is a way to place all the textviews that start with little bit space regarding the layout they located. For example I want that in the follwoing image all the textvies will not touch in the border of layout sucah as the word "place","location","Between","When" are doing.
This is current situation:
and this is my xml code:
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/relativlayoutGcmMessage"
android:background="#ffffff">
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:id="#+id/separatorUp"
android:visibility="visible"
android:background="#FF0000"
android:layout_marginTop="25dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/textlayout"
android:layout_marginTop="5dp"
android:layout_below="#+id/separatorUp"
android:background="#drawable/edit_text_style_focused"
android:layout_margin="10dp"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User ,"
android:gravity="center"
android:id="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:textSize="20sp"
android:textColor="#FF0000" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="this is the message"
android:textSize="20sp"
android:layout_marginLeft="5dp"
android:layout_below="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000000" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Button
android:text="Join"
android:id="#+id/ButtonJoin"
android:textColor="#ffffff"
android:background="#606060"
android:layout_margin="10dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
>
</Button>
<Button
android:text="Deny"
android:id="#+id/ButtonDeny"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="#ffffff"
android:background="#606060"
>
</Button>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/relativeLayoutTextVals"
android:layout_marginTop="20dp"
android:layout_margin="10dp"
android:background="#drawable/edit_text_style_focused"
android:layout_below="#+id/textlayout"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:id="#+id/row2"
android:layout_below="#+id/row1"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Between:"
android:id="#+id/textViewbtwn"
android:textColor="#FF0000"
android:textStyle="bold"
android:textSize="20sp"
android:layout_weight="0.62" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Time"
android:id="#+id/textViewtime"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_weight="1.45"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row3"
android:layout_below="#+id/row2"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Location:"
android:id="#+id/textViewloc"
android:textStyle="bold"
android:textColor="#FF0000"
android:textSize="20sp"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="place"
android:layout_marginLeft="10dp"
android:id="#+id/textViewPlace"
android:textSize="20sp"
android:layout_weight="2.28"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row1"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="When:"
android:id="#+id/textViewWhen"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="#FF0000"
android:layout_weight="51.15" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Date"
android:layout_marginLeft="10dp"
android:id="#+id/textViewDate"
android:textSize="20sp"
android:layout_weight="115.29"
android:textColor="#000000" />
</TableRow>
</RelativeLayout>
</RelativeLayout>
Try another approach as follows , it works as per your requirement
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativlayoutGcmMessage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<View
android:id="#+id/separatorUp"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:background="#FF0000"
android:visibility="visible" />
<RelativeLayout
android:id="#+id/textlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/separatorUp"
android:layout_margin="10dp"
android:layout_marginTop="5dp"
android:padding="10dp">
<TextView
android:id="#+id/textViewUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="User ,"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textViewUser"
android:layout_marginLeft="5dp"
android:text="this is the message"
android:textColor="#000000"
android:textSize="20sp" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal">
<Button
android:id="#+id/ButtonJoin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Join"
android:textColor="#ffffff"></Button>
<Button
android:id="#+id/ButtonDeny"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Deny"
android:textColor="#ffffff">
</Button>
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayoutTextVals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textlayout"
android:layout_margin="10dp"
android:layout_marginTop="20dp">
<LinearLayout
android:id="#+id/row2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row1"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewbtwn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Between:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewtime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Time"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row2"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewloc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Location:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewPlace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="place"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center"
android:layout_margin="5dp"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="#+id/textViewWhen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="When:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Date"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

Text size is not getting changed for different screen layouts?

I am trying to make my app multi screen supportable for that I have created different layout folders like layout-large , layout-small ,layout-xlarge , layout-sw320dp , layout-sw480dp , I have set text size in sp in each folder and i have mentioned different text sizes for every layout folder but text is not getting changed.
Here is my xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/gray_pager"
android:orientation="vertical"
>
<LinearLayout
android:id="#+id/firstscreen_call_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/firstscreen_layout_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="#color/call_list_1"
>
<TextView
android:id="#+id/call_list_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:paddingLeft="10dp"
android:text="Call List"
android:textSize="32sp" />
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="5dp"
android:scaleType="fitXY"
android:src="#drawable/cm_phone_icon"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.45"
android:background="#color/call_list_2"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
>
<TextView
android:id="#+id/call_list_client_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="350" />
<TextView
android:id="#+id/call_list_client_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Clients 99 Priority" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#color/gray_bg" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/call_list_service_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="3250" />
<TextView
android:id="#+id/call_list_service_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:maxLines="2"
android:text="Servicing Contacts" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/call_list_assigned_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="250" />
<TextView
android:id="#+id/call_list_assigned_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Assigned Contacts" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/call_list_custom_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="6" />
<TextView
android:id="#+id/call_list_custom_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Custom List" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/firstscreen_client_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/firstscreen_layout_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="#color/client_note_1">
<TextView
android:id="#+id/client_note_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:paddingLeft="10dp"
android:text="Client Note"
android:textSize="32sp"
android:textStyle="normal" />
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="5dp"
android:scaleType="fitXY"
android:src="#drawable/cm_note_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.45"
android:background="#color/client_note_2"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
>
<TextView
android:id="#+id/client_note_notes_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="10" />
<TextView
android:id="#+id/client_note_notes_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:maxLines="2"
android:text="Notes Logged Today" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/client_note_meeting_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:gravity="center"
android:text="7" />
<TextView
android:id="#+id/client_note_meeting_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:maxLines="2"
android:text="Meetings Schedule" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/client_note_phone_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="6" />
<TextView
android:id="#+id/client_note_phone_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Phone Calls" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/client_note_email_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="4" />
<TextView
android:id="#+id/client_note_email_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Email(s) Sent" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/firstscreen_to_do_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/firstscreen_layout_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="#color/to_do_list_1">
<TextView
android:id="#+id/todolist_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:paddingLeft="10dp"
android:text="To-Do List"
android:textSize="32sp" />
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="5dp"
android:src="#drawable/cm_todo_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.45"
android:background="#color/to_do_list_2"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/todolist_open_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="20" />
<TextView
android:id="#+id/todolist_open_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Open Task" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/todolist_expire_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="5" />
<TextView
android:id="#+id/todolist_expire_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Expiring Today" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/todolist_direct_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="25" />
<TextView
android:id="#+id/todolist_direct_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:maxLines="2"
android:textSize="15sp"
android:text="Directed Calls" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#color/gray_bg" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/todolist_action_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:gravity="center"
android:text="2" />
<TextView
android:id="#+id/todolist_action_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:gravity="center"
android:maxLines="2"
android:text="Actions Pending" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/firstscreen_road_show"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/firstscreen_layout_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="#color/roadshow_1">
<TextView
android:id="#+id/roadshow_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:paddingLeft="10dp"
android:text="Roadshow"
android:textSize="32sp" />
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="5dp"
android:scaleType="fitXY"
android:src="#drawable/cm_roadshow_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.45"
android:background="#color/roadshow_2"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/roadshow_meeting_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="10" />
<TextView
android:id="#+id/roadshow_meeting_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="Meetings Schedule" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/roadshow_ongoing_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="5" />
<TextView
android:id="#+id/roadshow_ongoing_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:gravity="center"
android:text="Ongoing Roadshow" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/roadshow_future_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="1" />
<TextView
android:id="#+id/roadshow_future_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="Future Roadshow" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#e1e1e1" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/roadshow_mtoday_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="2" />
<TextView
android:id="#+id/roadshow_mtoday_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15sp"
android:text="Meetings Today" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
For best practice for text size we need to simply define the text size is sp .
and we should set text as below
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.textSize));

Facing an issue with listview display

I am having five columns displaying data,the issue i am facing is the fifth column data is not visible its getting hidden as well the column heading and the data are not getting properly aligned.Following is my xml for data display
<TextView
android:id="#+id/textView1"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10dp"
android:textColor="#000000"
android:text="TextView" />
<TextView
android:id="#+id/textViewStyle"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10dp"
android:textColor="#000000"
android:text="23" />
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView
android:id="#+id/textView2"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="TextView" />
<TextView
android:id="#+id/textView21"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10dp"
android:textColor="#000000"
android:text="23" />
<TextView
android:id="#+id/textView22"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10dp"
android:textColor="#000000"
android:text="23" />
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView
android:id="#+id/textView3"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="455" />
<TextView
android:id="#+id/textView31"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="554" />
<TextView
android:id="#+id/textView32"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="755" />
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView
android:id="#+id/textView4"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="#000000"
android:textSize="10dp"
android:text="6654" />
<TextView
android:id="#+id/textView41"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="7676" />
<TextView
android:id="#+id/textView42"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="10dp"
android:text="7765" />
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView
android:id="#+id/textView5"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="#000000"
android:textSize="10dp"
android:text="12" />
<TextView
android:id="#+id/textView51"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="#000000"
android:textSize="10dp"
android:text="45" />
<TextView
android:id="#+id/textView52"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:textColor="#000000"
android:textSize="10dp"
android:text="644" />
</LinearLayout>
</LinearLayout>
and the listview xml is has below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#android:color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_margin="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="12345617890" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:fontFamily="#android:color/black"
android:text="Ramakrisha Tripati" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="9876543210" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="13/1/2015" />
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Rohit Sharma" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:orientation="horizontal"
android:background="#F5D8BA">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="item#\nstyle#"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M Wt\nD Wt\nCS Wt"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Making\nD Rate\nCS Rate"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Margin\nDis %\nDiscount"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GT\nFSP"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="#00000000"
android:dividerHeight="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textColor="#000000"
android:text="Comment" />
<EditText
android:id="#+id/editText2"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:ems="10"
android:hint="Comment goes here"
android:inputType="textMultiLine" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal">
<Button
android:id="#+id/buttonAcc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:textColor="#000000"
android:background="#drawable/mybutton"
android:layout_marginLeft="20dp"
android:text="Accept" />
<Button
android:id="#+id/buttonRej"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:textColor="#000000"
android:background="#drawable/mybutton"
android:layout_marginLeft="100dp"
android:text="Reject" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content" android:orientation="vertical">
because of that
why you not use tablelayout?
Just replace your All Linear Layouts under "xml for data display"
<LinearLayout
android:layout_width="100dp"
android:layout_height="wrap_content"
android:orientation="vertical">
With this
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical">
You can see your fifth Layout.

How to arrange layouts with many view controls

I want the screen like this :
![my screen schema][1] [1]: http://i.stack.imgur.com/PBt0i.png
How should be the layout?
I have given some fixed width and height but this is not good practice please help me in designing this screen.
For more details below is my xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".QuestionBankActivity" >
<RelativeLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:background="#drawable/orangewood"
android:gravity="top"
android:orientation="horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="3dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp"
android:background="#drawable/blue_gray_back"
android:gravity="center_vertical|center_horizontal"
android:padding="5dp"
android:paddingTop="1dp"
android:text="#string/QuesPalet"
android:textColor="#android:color/background_light"
android:typeface="serif" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:layout_alignBottom="#+id/button1"
android:layout_alignParentRight="true"
android:layout_marginRight="22dp"
android:padding="5dp"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="invisible" />
<Chronometer
android:id="#+id/chronometer1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/button1"
android:layout_alignBottom="#+id/button1"
android:layout_alignParentRight="true"
android:layout_marginRight="22dp"
android:padding="5dp"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="invisible" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/button1"
android:padding="5dp" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignLeft="#+id/textView3"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:gravity="center|center_horizontal|center_vertical"
android:padding="5dp"
android:textColor="#android:color/background_light"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<WebView
android:id="#+id/webView1"
android:layout_width="match_parent"
android:layout_height="334dp"
android:layout_below="#+id/linearLayout2"
android:paddingBottom="10dp"
android:scrollbars="vertical" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/radioGroup1"
android:layout_centerHorizontal="true"
android:weightSum="4"
android:background="#drawable/orangewood"
android:orientation="horizontal" >
<Button
android:id="#+id/reviewBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#drawable/blue_gray_back"
android:gravity="left"
android:textColor="#FFFFFF"
android:typeface="serif" />
<Button
android:id="#+id/clearBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/blue_gray_back"
android:layout_weight="1"
android:textColor="#FFFFFF"
android:typeface="serif" />
<Button
android:id="#+id/saveNextBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/blue_gray_back"
android:layout_weight="1"
android:gravity="left"
android:textColor="#FFFFFF"
android:typeface="serif" />
</LinearLayout>
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/webView1"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:orientation="horizontal"
android:weightSum="4" >
<RadioButton
android:id="#+id/radio0"
android:layout_marginLeft=""
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="20sp"
android:gravity="fill_vertical"
android:textStyle="bold"
android:textColor="#000000"
android:button="#drawable/custom_radio"
/>
<RadioButton
android:id="#+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="#drawable/custom_radio"
android:textSize="20sp"
android:gravity="fill_vertical"
android:textStyle="bold"
android:textColor="#000000"/>
<RadioButton
android:id="#+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="#drawable/custom_radio"
android:textSize="20sp"
android:gravity="fill_vertical"
android:textStyle="bold"
android:textColor="#000000" />
<RadioButton
android:id="#+id/radio3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#drawable/custom_radio"
android:textSize="20sp"
android:gravity="fill_vertical"
android:textStyle="bold"
android:layout_weight="1"
android:textColor="#000000" />
</RadioGroup>
</RelativeLayout>
Thanks!!
Note that I am using scale to width of views but this is bad coding because it will not fit to various screens.Please correct me if I am wrong! feel free to ask any details regarding this problem..
its a dummy code check this and create your own :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
<WebView
android:id="#+id/webView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout2"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linearLayout1" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/linearLayout3"
android:layout_alignParentLeft="true" >
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="RadioButton" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="RadioButton" />
<RadioButton
android:id="#+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="RadioButton" />
<RadioButton
android:id="#+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="RadioButton" />
</LinearLayout>
First you need relative layout and Linearlayout... and scrollLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#color/white" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="36dp"
android:background="#e66b7a">
//put here btn and textview
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="4.12"
android:background="#color/white" >
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/imageView1"
android:background="#color/white"
android:paddingTop="5dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="3dp" >
<WebView
android:id="#+id/webcontain"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
//put here radio button
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.08"
android:background="#drawable/topbar" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/footer"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/footer"
android:gravity="center"
android:orientation="vertical" >
<Button
android:id="#+id/imageButton7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/footer"
android:gravity="center"
android:orientation="vertical" >
<Button
android:id="#+id/imageButton9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/footer"
android:gravity="center"
android:orientation="vertical" >
<Button
android:id="#+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
And this is code for 4 radio button.. this will fit in all size of screens
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/white"
android:orientation="vertical"
android:gravity="center">
<Button
android:id="#+id/okbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/white"
android:orientation="vertical"
android:gravity="center">
<Button
android:id="#+id/okbuttodn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/white"
android:orientation="vertical"
android:gravity="center">
<Button
android:id="#+id/okbuttdtgyodn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/white"
android:orientation="vertical"
android:gravity="center">
<Button
android:id="#+id/okbuttrtodn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SET"
/>
</LinearLayout>
</LinearLayout>
Use like below:
<?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:orientation="vertical" >
<LinearLayout
android:id="#+id/layout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Medium Text1"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Medium Text2"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/weblayout1"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_below="#+id/layout1"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="1"
android:text="Webview"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/rdbtndlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/weblayout1"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rd1" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rd2" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rd3" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rd4" />
</LinearLayout>
<LinearLayout
android:id="#+id/btnlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rdbtndlayout"
android:orientation="horizontal" >
<Button
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button1" />
<Button
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button2" />
<Button
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button3" />
</LinearLayout>
<LinearLayout>
</RelativeLayout >
You can place your webview and radiogroups inside respective layouts
Try this..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/first_lay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_txt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:layout_weight="1"
android:gravity="center"
android:text="Button" />
<Chronometer
android:id="#+id/chronometer1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="TextView"
android:textSize="20dp" />
</LinearLayout>
<WebView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radio0"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="fill_vertical"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radio1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="fill_vertical"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radio2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="fill_vertical"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radio3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="fill_vertical"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
</RadioGroup>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal" >
<Button
android:id="#+id/reviewBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/clearBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/saveNextBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
</LinearLayout>
you can use this.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:orientation="vertical"
tools:context=".QuestionBankActivity" >
<RelativeLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="5dp"
android:background="#ff0000"
android:gravity="top"
android:orientation="horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="3dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp"
android:background="#000"
android:gravity="center_vertical|center_horizontal"
android:padding="5dp"
android:paddingTop="1dp"
android:text="QuesPalet"
android:textColor="#android:color/background_light"
android:typeface="serif" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp"
android:gravity="center|center_horizontal|center_vertical"
android:padding="5dp"
android:text="TextView"
android:textColor="#android:color/background_light"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<WebView
android:id="#+id/webView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".8"
android:paddingBottom="10dp"
android:scrollbars="vertical" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".1"
android:orientation="horizontal" >
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radio0"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="1"
android:textColor="#ff0000" />
<RadioButton
android:id="#+id/radio1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="2"
android:textColor="#ff0000" />
<RadioButton
android:id="#+id/radio2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="3"
android:textColor="#ff0000" />
<RadioButton
android:id="#+id/radio2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4"
android:textColor="#ff0000" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".1"
android:orientation="horizontal" >
<Button
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Button" />
<Button
android:id="#+id/button4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

Categories

Resources