Android table layout starts from the edge of the phone - java

I'm using table layout to show some data but the table starts from the edge of the phone from left to right. How do i do if i want the entire table at the center and some space on right and left. Please advice. Below is my code.
Code
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF" >
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="2" >
<LinearLayout android:gravity="left" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="150dp"
android:layout_height="50dp"
android:src="#drawable/ezwaybill" />
</LinearLayout>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="150dp"
android:layout_height="50dp"
android:src="#drawable/van" />
</TableRow>
<LinearLayout android:gravity="center" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SENDER"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="22sp" />
</LinearLayout>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView1"
android:text="Account"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText1"
android:layout_span="2"
android:editable="false"
android:text="0001"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView3"
android:text="Tel"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText2"
android:layout_span="2"
android:editable="false"
android:text="01111022408615"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView5"
android:text="Add"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText3"
android:layout_span="2"
android:editable="false"
android:text="No. 7, Ferrers Park"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView5"
android:text="Country"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText4"
android:layout_span="2"
android:editable="false"
android:text="Malaysia"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView6"
android:text="Postcode "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText5"
android:layout_span="2"
android:editable="false"
android:text="44800"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView7"
android:text="Email"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText6"
android:layout_span="2"
android:editable="false"
android:text="customer#domain.com"
android:textSize="15sp" />
</TableRow>
<TextView
android:layout_width="10dp"
android:layout_height="10dp" />
</TableLayout>
</ScrollView>

use this code it look like as shown in image
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" >
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="2"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_gravity="center">
<LinearLayout android:gravity="left" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="150dp"
android:layout_height="50dp"
android:src="#drawable/ic_launcher" />
</LinearLayout>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="150dp"
android:layout_height="50dp"
android:src="#drawable/ic_launcher" />
</TableRow>
<LinearLayout android:gravity="center" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SENDER"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="22sp" />
</LinearLayout>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView1"
android:text="Account"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText1"
android:layout_span="2"
android:editable="false"
android:text="0001"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView3"
android:text="Tel"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText2"
android:layout_span="2"
android:editable="false"
android:text="01111022408615"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView5"
android:text="Add"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText3"
android:layout_span="2"
android:editable="false"
android:text="No. 7, Ferrers Park"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView5"
android:text="Country"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText4"
android:layout_span="2"
android:editable="false"
android:text="Malaysia"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView6"
android:text="Postcode "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText5"
android:layout_span="2"
android:editable="false"
android:text="44800"
android:textSize="15sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:padding="2dip" >
<TextView
android:id="#+id/textView7"
android:text="Email"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="15sp" />
<EditText
android:id="#+id/editText6"
android:layout_span="2"
android:editable="false"
android:text="customer#domain.com"
android:textSize="15sp" />
</TableRow>
<TextView
android:layout_width="10dp"
android:layout_height="10dp" />
</TableLayout>
</ScrollView>

Give your main View a Size and set android:layout_gravity="center". (Not sure if this works with Views). So they dont fill the Parent.
Else just give it a
android:layout_marginLeft="150dp"
android:layout_marginRight="150dp"
for example.
best regards

Related

How to decrease the space between column

I have this table:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<TableLayout
android:id="#+id/tableLayout"
android:layout_width="369dp"
android:layout_height="118dp"
android:layout_marginTop="224dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/q1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="A:" />
<TextView
android:id="#+id/q2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="15%" />
<TextView
android:id="#+id/q3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/editTextBackground"
android:layout_weight="1.5"
android:clickable="false"
android:cursorVisible="false"
android:focusable="false"
android:textColor="#000000" />
<TextView
android:id="#+id/q4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="20%" />
<TextView
android:id="#+id/q5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000"
/>
<TextView
android:id="#+id/q6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="25%" />
<TextView
android:id="#+id/q7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000"
/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/a1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="B:" />
<TextView
android:id="#+id/a2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="15%" />
<TextView
android:id="#+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000"
/>
<TextView
android:id="#+id/b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="20%" />
<TextView
android:id="#+id/b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000"
/>
<TextView
android:id="#+id/b4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="25%" />
<TextView
android:id="#+id/b5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000"
/>
</TableRow>
</TableLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
How to make the columns closer together?
To make less space between 15% and underscore?
Used below codes
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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">
<TableLayout
android:id="#+id/tableLayout"
android:layout_width="369dp"
android:layout_height="118dp"
android:layout_marginTop="224dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/q1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:text="A:" />
<TextView
android:id="#+id/q2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="15%" />
<TextView
android:id="#+id/q3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:clickable="false"
android:cursorVisible="false"
android:focusable="false"
android:textColor="#000000" />
<TextView
android:id="#+id/q4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="20%" />
<TextView
android:id="#+id/q5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000" />
<TextView
android:id="#+id/q6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="25%" />
<TextView
android:id="#+id/q7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/a1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:text="B:" />
<TextView
android:id="#+id/a2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="15%" />
<TextView
android:id="#+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000" />
<TextView
android:id="#+id/b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="20%" />
<TextView
android:id="#+id/b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000" />
<TextView
android:id="#+id/b4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="center"
android:text="25%" />
<TextView
android:id="#+id/b5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/editTextBackground"
android:textColor="#000000" />
</TableRow>
</TableLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Output :

How to design in 10 inch tablet only in portrait mode in Android?

I have to design an application for 10 inch tab in Android.But when i run the application the design is in blur or not clear .I don't know why. I have also declare the android:screenOrientation="portrait" in manifest .How to design properly and where I'm doing wrong in xml file.Thanks in advance.
Here is my xml file code
<?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="#android:color/white" >
<ImageView
android:id="#+id/imageLogoBBT"
android:layout_width="400dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:contentDescription="#string/desc"
android:scaleType="fitXY"
android:src="#drawable/banya_tree_logo" />
<ImageView
android:id="#+id/imageButtonBack"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="15dp"
android:layout_marginTop="18dp"
android:contentDescription="#string/desc"
android:scaleType="fitCenter"
android:src="#drawable/back_img" />
<RelativeLayout
android:id="#+id/relImagLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/imageLogoBBT"
android:background="#drawable/inner_back"
android:padding="5dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E6E9E9" >
<TextView
android:id="#+id/textViewTitle"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="#string/APPLICATION_FOR_FUND_TRANSFER"
android:textColor="#32241F"
android:textSize="25sp"
android:textStyle="bold" >
</TextView>
<TextView
android:id="#+id/APPLICANTS_INFORMATION_Detail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewTitle"
android:layout_marginLeft="10dp"
android:text="#string/APPLICANTS_INFORMATION"
android:textColor="#32241F"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/linearScroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/lastrowLayout"
android:layout_below="#+id/APPLICANTS_INFORMATION_Detail"
android:baselineAligned="false"
android:orientation="horizontal" >
<ScrollView
android:id="#+id/scrollFormOne"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="2dp" >
<LinearLayout
android:id="#+id/linearlayout_One"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearlayout_textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.10"
android:gravity="left"
android:text="#string/title"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:gravity="left"
android:paddingLeft="5dp"
android:text="#string/last_name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:gravity="left"
android:paddingLeft="5dp"
android:text="#string/first_name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearlayout_EditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:baselineAligned="false"
android:orientation="horizontal" >
<Spinner
android:id="#+id/gps_spinnertitleName"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_weight="0.10"
android:background="#drawable/button_shape"
android:gravity="center"
android:inputType="text"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gps_edittextLastName"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:background="#drawable/button_shape"
android:gravity="left"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gps_editTextFirst"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:background="#drawable/button_shape"
android:gravity="left"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ScrollView
android:id="#+id/scrollFrorm_Two"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="2dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/Beneficiary_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Account_No"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Account_No"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="number"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Bank_Name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Bank_Name"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Bank_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Bank_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/BIC_Chips_ID_BSB_Code_Fed_Wire_ABA_Sort_Code"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_BIC_Chips_ID_BSB"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Intermediary_Bank_Name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Intermediary_Bank_Name"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Intermediary_Bank_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Intermediary_Bank_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="#+id/lastrowLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="7dp"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="10dp" >
<CheckBox
android:id="#+id/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="#string/I_Accept_Terms_Conditions"
android:textColor="#android:color/black" />
<ImageView
android:id="#+id/buttonSubmit_Next"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_weight="0.40"
android:contentDescription="#string/desc"
android:src="#drawable/next_btton" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
Screen Shot 2014-06-24 at 4.05.30 PM
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
// your left side part
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
// your right side part
</LinearLayout>
</LinearLayout>
and also use different images for 10 inch tablets
Do not scale the images using layout_width or layout_height by your self. I can see in the ImageView you have specified dp values, this will make system to scale your image which may cause blur. Instead use size and density-specific resources inside drawable folders like
res/drawable-mdpi/icon.png //for medium-density screens
res/drawable-hdpi/icon.png //for high-density screens
You can create specific layout suitable to the screen size and palce it in res\layout-xxx folders
Wherever possible use 9-patch images
If you have only one image and have to be scaled for different screen then use highest resolution image and keep it in drawable-nodpi folder and specify either height or width and lets system decide other so that image get scaled properly.
Read : http://developer.android.com/guide/practices/screens_support.html#screen-independence
Image scaling: http://argillander.wordpress.com/2011/11/24/scale-image-into-imageview-then-resize-imageview-to-match-the-image/

Adjusting the gridview and roe of buttons

I am trying to adjust the space between grid view and buttons
I have posted figure
I am trying to attain that
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:orientation="vertical" >
<!-- Top navigation bar for Restaurant Description Page -->
<TableRow
android:id="#+id/tableRow6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >
<RelativeLayout
android:id="#+id/TopNavigationBarRestaurantDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#726E6D" >
<!-- Back Button -->
<Button
android:id="#+id/TopNavigationBarRestaurantDescActivityBackButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="BACK"
android:textColor="#android:color/white"
android:textSize="12sp" />
<!-- Restaurant Description page name -->
<TextView
android:id="#+id/TopNavigationBarRestaurantDescActivityName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="TextView"
android:textColor="#android:color/white"
android:textSize="18sp"
android:textStyle="bold" />
<!-- Restaurant Description page Image -->
<ImageView
android:id="#+id/TopNavigationBarRestaurantDescActivityImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="#drawable/ic_launcher" />
</RelativeLayout>
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >
<TextView
android:id="#+id/RestaurantTimingsID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Timings"
android:textStyle="bold" />
</TableRow>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp" >
</LinearLayout>
<TableRow
android:id="#+id/BuyReservedButtonRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2sp" >
<Button
android:id="#+id/BuyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/buy_button_shape"
android:paddingBottom="13dp"
android:paddingLeft="16dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Buy"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6sp" />
<Button
android:id="#+id/ReservedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/reserverd_button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Reserve"
android:textColor="#android:color/white" />
</TableRow>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableRow
android:id="#+id/DescriptionTitleRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >
<GridView
android:id="#+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="80dp"
android:gravity="center"
android:numColumns="3"
android:scrollbars="horizontal"
android:stretchMode="spacingWidthUniform" >
</GridView>
</TableRow>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp" >
</LinearLayout>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal" >
<Button
android:id="#+id/RestaurantDescriptionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Description"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantLocationButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Location"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantPhotosButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Photos"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantFriendsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Friends"
android:textColor="#android:color/white"
android:textSize="11sp" />
</LinearLayout>
</TableRow>
<TableRow
android:id="#+id/tableRow7"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal" >
<Button
android:id="#+id/RestaurantSearchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Search"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantFeaturedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Featured"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantDealsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Deals"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantInviteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Invite"
android:textColor="#android:color/white"
android:textSize="11sp" />
<Button
android:id="#+id/RestaurantAccountButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Account"
android:textColor="#android:color/white"
android:textSize="11sp" />
</LinearLayout>
</TableRow>
</LinearLayout>
</LinearLayout>
How to remove the space between the grid view and below row of buttons
How to remove the space below gridview
Try below segment of code, replace with your code and pls check once.
<TableRow
android:id="#+id/DescriptionTitleRow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="2sp" >
<GridView
android:id="#+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="80dp"
android:gravity="center"
android:numColumns="3"
android:scrollbars="horizontal"
android:stretchMode="spacingWidthUniform" >
</GridView>
</TableRow>

Why different android versions display different GUI?

Please have a look at the following code
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF"
android:gravity="right"
android:padding="5dp"
android:paddingBottom="5dp"
android:stretchColumns="1,2,3"
tools:context=".MainActivity" >
<TableRow
android:id="#+id/tableRow0"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/billTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/billTextView"
android:textColor="#000" />
<EditText
android:id="#+id/billEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="3"
android:layout_weight="1"
android:inputType="numberDecimal"
android:longClickable="false" >
<requestFocus />
</EditText>
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="1"
android:gravity="center"
android:text="10%"
android:textColor="#000" />
<TextView
android:id="#+id/fifteenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="15%"
android:textColor="#000" />
<TextView
android:id="#+id/twentyTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="20%"
android:textColor="#000" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/tipTxtView"
android:textColor="#000" />
<EditText
android:id="#+id/tip10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/tip15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/tip20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/totalTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/totalTextView"
android:textColor="#000" />
<EditText
android:id="#+id/total10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/total15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/total20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/customTextView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:padding="5dp"
android:text="#string/customTextView"
android:textColor="#000" />
<SeekBar
android:id="#+id/customSeekBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:layout_weight="1"
android:focusable="false"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progress="18" />
<TextView
android:id="#+id/customTipTextView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="a"
android:textColor="#000" />
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/tipCustomTextView"
android:textColor="#000" />
<EditText
android:id="#+id/tipCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<TextView
android:id="#+id/totalCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center|right"
android:padding="5dp"
android:text="#string/totalCustomTextView"
android:textColor="#000" />
<EditText
android:id="#+id/totalCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
</TableLayout>
The project is created using Android Version 3.2.
This is how it get displayed in Galaxy Nexus, which is set to Android version 2.3.3
This is how it get displayed in Galaxy Nexus, which is set to Android version 3.2
As you can see, in that new version one, the GUI is bit upset. It seems like the components are overlapping. That is why it doesn't show the borders of the components. Please help!
Yep, this is normal. The visual appearance of Android has been greatly polished with Android 4.0. It has nothing to do with your code directly. Android does this automatically.
If you want all your users to see the old style, you can set down the targetVersion within the <uses-sdk> tag of your manifest file. However, I discourage you from doing this.

Multiple TableLayouts inside a LinearLayout - Android

I am attempting to place multiple TableLayouts inside of a LinearLayout. When I implemented the code and ran it, the display was my background image with nothing displayed on it. Not sure what happened.
Before I tried to do this, I had everything displaying correctly but it was so much text that it had to be extremely small to make everything fit. To fix this I want to do 3 TableLayouts with the middle one being a ScrollView (I will worry about implementing the ScrollView after I fix the problem at hand).
My question is how to make all 3 TableLayouts visible with each being a specific percentage of the screen.
Below is 100% of the code for this XML file.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/tableLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1"
android:shrinkColumns="0"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="70dp"
android:paddingBottom="70dp"
android:background="#drawable/scroll" >
<TableLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="15" >
<TableRow
android:id="#+id/header"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/category"
android:layout_height="wrap_content"
android:layout_width="0px"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="15sp"
android:paddingTop="10dp"
android:gravity="center_horizontal" />
<TableLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TableRow
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/points"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:gravity="left"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/percentage"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:gravity="left"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/total_score"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:gravity="left"
android:textStyle="bold" />
</TableRow>
</TableLayout>
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#000001" />
<TableRow
android:id="#+id/row3"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="#+id/imageColumn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0" />
<TextView
android:id="#+id/questionColumn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="10sp"
android:textStyle="bold|italic"
android:gravity="center_vertical" />
<TextView
android:id="#+id/answerColumn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="10sp"
android:textStyle="bold|italic"
android:gravity="center_vertical" />
<TextView
android:id="#+id/verseColumn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="10sp"
android:textStyle="bold|italic"
android:gravity="center_vertical" />
</TableRow>
</TableLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="70" >
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
<ImageView
android:id="#+id/q1Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q1Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q1Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q1Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row5"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q2Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q2Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q2Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q2Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row6"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q3Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q3Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q3Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q3Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row7"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q4Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q4Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q4Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q4Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row8"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q5Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q5Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q5Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q5Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row9"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q6Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q6Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q6Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q6Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row10"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q7Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q7Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q7Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q7Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row11"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q8Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q8Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q8Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q8Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row12"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q9Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q9Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q9Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q9Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#C2BEBF" />
<TableRow
android:id="#+id/row13"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1,2,3"
android:layout_weight="1" >
<ImageView
android:id="#+id/q10Image"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q10Question"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".45"
android:textSize="7sp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q10Answer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".3"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
<TextView
android:id="#+id/q10Verse"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:textSize="7sp"
android:layout_gravity="center_vertical" />
</TableRow>
</TableLayout>
</ScrollView>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="15" >
<TableRow
android:id="#+id/row14"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:stretchColumns="0,1"
android:layout_weight="1" >
<Button
android:id="#+id/mainmenuBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".33"
android:textSize="7sp" />
<Button
android:id="#+id/highscoresBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".33"
android:textSize="7sp" />
<Button
android:id="#+id/playBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".34"
android:textSize="7sp" />
</TableRow>
</TableLayout>
</LinearLayout>
Do you want the tables to be side by side, or on top of eachother? You have the orientation of your LinearLayout set to "vertical" now, but the width of each table as "0dip". I imagine you want them side by side, which means the orientation of the LinearLayout should be "horizontal", and keep your table widths as "0dip". If you do in fact want them on top of eachother, change the width for each table to "wrap_content" or "match_parent" and the height to "0dip".
Vertical example
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="15" >
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="70" >
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="15" >
</TableLayout>
</LinearLayout>
Horizontal Example
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TableLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
</TableLayout>
<TableLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
</TableLayout>
<TableLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" >
</TableLayout>
</LinearLayout>
Bottom table edit
<TableLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="15" >
<TableRow
android:id="#+id/row14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="0,1" >
<Button
android:id="#+id/mainmenuBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="7sp" />
<Button
android:id="#+id/highscoresBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="7sp" />
<Button
android:id="#+id/playBtn"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="7sp" />
</TableRow>
</TableLayout>

Categories

Resources