ScrollView showing extra space while showing fragment - android

I have an issue where I am showing a fragment in a scrollview,but the thing is that the scrillview always shows extra space(or I think complete fragment page) while the data is only half page. How can I make scrollview not showing the whole fragment page and only the text part.I though of making the parent LinareLayout wrap in fragment activity but doesn't work for me.
The activity xml where inside a scrolview a LinearLayout is put and later I replace it with a fragment
<?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="#ffffffff"
android:orientation="vertical"
android:weightSum="10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1.1"
android:background="#FF52caf7"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:clickable="true"
android:onClick="backtoschedule"
android:src="#drawable/back" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.6">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:text="Schedule Order"
android:textColor="#FFFFFFFF"
android:textSize="#dimen/txtm" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="7.9"
android:background="#drawable/pbackground"
android:orientation="vertical"
android:weightSum="10.05">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5.975"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/defaultsofragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.025"
android:background="#ffd1d1d1" />
///////////////////////////////////////////////////////////////////////////
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal"
android:weightSum="10">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="6"
android:orientation="vertical"
android:weightSum="10">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:gravity="left"
android:paddingLeft="10dp"
android:text="Instruction"
android:textColor="#ff000000"
android:textSize="#dimen/txtss" />
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:gravity="left"
android:paddingLeft="10dp"
android:text="You agree with terms and conditions"
android:textColor="#ff000000"
android:textSize="#dimen/txts2" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:orientation="vertical"
android:weightSum="10">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:gravity="center|left"
android:text="Use Coupon"
android:textColor="#ff000000"
android:textSize="#dimen/txtss" />
<EditText
android:id="#+id/couponcode"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:layout_weight="6"
android:background="#drawable/edittextstyle"
android:gravity="center"
android:hint="coupon code"
android:textColor="#ff000000"
android:textColorHint="#FFABABAB"
android:textCursorDrawable="#null"
android:textSize="#dimen/txtss" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.025"
android:background="#ffd1d1d1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="#drawable/img"></LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:orientation="vertical">
<Button
android:id="#+id/button"
style="#android:style/TextAppearance.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="#ff57caf2"
android:onClick="orderconfirm"
android:text="Confirm Order"
android:textColor="#fff0f0f0"
android:textSize="#dimen/txtss" />
</LinearLayout>
</LinearLayout>
////////////////////////////////////////
The fragment activity 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="wrap_content"
android:background="#drawable/pbackground"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="*">
<TableRow
android:layout_weight="1"
android:gravity="left">
<TextView
android:layout_column="1"
android:padding="3dip"
android:text="ORDER DETAILS"
android:textAllCaps="true"
android:textColor="#000"
android:textSize="#dimen/txtss" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Delivery Type"
android:textColor="#ff000000"
android:textSize="#dimen/txts"
android:textStyle="bold" />
<TextView
android:id="#+id/dtype"
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Loading..."
android:textColor="#ff000000"
android:textSize="#dimen/txts" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Schedule Pickup"
android:textColor="#ff000000"
android:textSize="#dimen/txts"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Date"
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
<TextView
android:id="#+id/spdate"
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Loading..."
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Time"
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
<TextView
android:id="#+id/sptime"
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Loading..."
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Schedule DropOff"
android:textColor="#ff000000"
android:textSize="#dimen/txts"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Date"
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
<TextView
android:id="#+id/sddate"
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Loading..."
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left"
android:weightSum="1">
<TextView
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Time"
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
<TextView
android:id="#+id/sdtime"
android:layout_width="0dp"
android:layout_column="1"
android:layout_weight="0.5"
android:padding="3dip"
android:text="Loading..."
android:textColor="#FF000000"
android:textSize="#dimen/txts" />
</TableRow>
<View
android:layout_height="1dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:gravity="center" />
<TableRow
android:layout_weight="1"
android:gravity="left">
<TextView
android:layout_column="1"
android:padding="3dip"
android:text="Address"
android:textAllCaps="true"
android:textColor="#000"
android:textSize="#dimen/txtss" />
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="left">
<TextView
android:id="#+id/caddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:inputType="textMultiLine"
android:padding="3dip"
android:scrollbars="vertical"
android:text="Shanti Niketanjnkwejrkjwoperjposdasdasdasdasdasdasdwejprjwpoe,Lucknow,22-44-33"
android:textColor="#000"
android:textSize="#dimen/txts" />
</TableRow>
</TableLayout>
</LinearLayout>

use this attribute inside Scrollview..
android:fillViewport="true"

Related

How can i show this in xml file ??Anyone there Who can show me the sample code of this xml?

I wanna implement the XML file in my app, please anyone give me the pattern of this XML code??
I try it with table layout but it's not like is, Please anyone help me to give me the clear concept in details or sample code of this pattern
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1">
<TableRow>
<TextView
android:text="tumi"
android:padding="10dip" />
<TextView
android:text="ami"
android:gravity="right"
android:padding="10dip" />
</TableRow>
<TableRow>
<TextView
android:text="bal"
android:padding="10dip" />
<TextView
android:text="falau"
android:gravity="right"
android:padding="10dip" />
</TableRow>
<TableRow>
<TextView
android:text="bal"
android:padding="10dip" />
<TextView
android:text="falau"
android:gravity="right"
android:padding="10dip" />
</TableRow>
<TableRow>
<TextView
android:text="bal"
android:padding="10dip" />
<TextView
android:text="falau"
android:gravity="right"
android:padding="10dip" />
</TableRow>
<TableRow>
<TextView
android:text="bal"
android:padding="10dip" />
<TextView
android:text="falau"
android:gravity="right"
android:padding="10dip" />
</TableRow>
<TableRow>
<TextView
android:text="bal"
android:padding="10dip" />
<TextView
android:text="falau"
android:gravity="right"
android:padding="10dip" />
</TableRow>
</TableLayout>
enter image description hereenter image description here
Here is the output of my XML file
<?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">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/adview"
android:fillViewport="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/gray"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Name"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:drawableBottom="#drawable/settings"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:drawableBottom="#drawable/settings"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="1dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#color/white"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:text="Audio"
android:gravity="center"
android:textColor="#color/blue"
android:layout_height="wrap_content" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#color/blue" />
<TextView
android:layout_width="0dp"
android:layout_weight="0.5"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="Name"
android:textColor="#color/black"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<View
android:id="#+id/adview"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true" />
</RelativeLayout>

android:gravity not changing the position of the text in a TextView

I am writing code for an activity that has a table that initially contains 2 rows(see screenshot). I would like the text in those 2 rows to be in the center(not the TextView).
However, setting android:gravity = "center" or android:gravity = "center_horizontal" does not affect the text at all.
What am I missing?
Screenshot
activity_game.xml:
<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/white"
android:orientation="horizontal"
android:padding="16dp"
tools:context=".MainActivity">
<TableLayout
android:id="#+id/tl1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TableRow
android:id="#+id/tr_header_p1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:id="#+id/player1_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Player 1"
android:textColor="#000000"
android:textSize="24sp" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Guess"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Bulls"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Cows"
android:textColor="#000000"
android:textSize="16sp" />
</TableRow>
</TableLayout>
<TableLayout
android:id="#+id/tl2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TableRow
android:id="#+id/tr_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:id="#+id/player2_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Player 2"
android:textColor="#000000"
android:textSize="24sp" />
</TableRow>
<TableRow
android:id="#+id/tr_header2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Guess"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Bulls"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Cows"
android:textColor="#000000"
android:textSize="16sp" />
</TableRow>
</TableLayout>
Try this should work,
add android:gravity="center" to your #+id/tr_header_p1 and #+id/tr_header
like,
<TableRow
android:id="#+id/tr_header_p1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="5dp">
and
<TableRow
android:id="#+id/tr_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="5dp">
this might helps you
EDIT 1
or you need to mention the android:layout_weight="1" to your TextView. like
<TextView
android:id="#+id/player2_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:text="Player 2"
android:textColor="#000000"
android:textSize="24sp" />
Try 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/white"
android:orientation="horizontal"
android:padding="16dp"
tools:context=".MainActivity">
<TableLayout
android:id="#+id/tl1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TableRow
android:id="#+id/tr_header_p1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:id="#+id/player1_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Player 1"
android:textColor="#000000"
android:textSize="24sp" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Guess"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Bulls"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Cows"
android:textColor="#000000"
android:textSize="16sp" />
</TableRow>
</TableLayout>
<TableLayout
android:id="#+id/tl2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TableRow
android:id="#+id/tr_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:id="#+id/player2_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Player 2"
android:textColor="#000000"
android:textSize="24sp" />
</TableRow>
<TableRow
android:id="#+id/tr_header2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:padding="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Guess"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/table_cell_bg"
android:gravity="center"
android:text="Bulls"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Cows"
android:textColor="#000000"
android:textSize="16sp" />
</TableRow>
</TableLayout>
</LinearLayout>
You can try setting layout_width to wrap_content and then set layout_gravity to center.
That align the entire TextView and not the text inside it
What if you used android:layout_gravity from your TextView which is gonna affect the position of the element according its parent? There's a thread explaining the difference between both below
Gravity and layout_gravity on Android
<TableRow
android:id="#+id/tr_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/table_row_bg"
android:gravity="center_horizontal"
android:padding="5dp">
<TextView
android:id="#+id/player2_name"
android:layout_width="match_parent"
android:gravity="center"
android:text="Player 2"
android:textColor="#000000"
android:textSize="24sp" />
</TableRow>
This is working for me
try for the TableRow parent of TextView
android:gravity="CENTER_HORIZONTAL"
the default layout of a table it's applied to children nodes, as described in documentation here

Align textviews to left and right

I have problem with textviews alignment. I want to align two textviews for the listview item to left and to right. In the Android Studio editor it's ok but when I'm deploying application to the device it's not right aligned. I don't know what is the problem. Below is my layout:
Found the problem. Issue actually was with the listview by mistake I set Listview's layout_width="wrap_content" but should be match_parent. As the mentioned layout is the list's item layout. Thanks everyone.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="#dimen/activity_horizontal_margin"
android:orientation="vertical">
<TextView
android:id="#+id/tv_order_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
<TextView
android:id="#+id/tv_order_category_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
<TextView
android:id="#+id/tv_order_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="35sp"/>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_tin_ein"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_tin_ein"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:text="Test"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="#string/order_address"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_address"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_email"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_phone"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_mobile"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_mobile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_fax"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_fax"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_created_date"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_created_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_start_working_date"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_start_working_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_end_date"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_end_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_cost"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/order_vat"
android:gravity="left"
android:layout_weight="1"
android:textStyle="bold"/>
<TextView
android:id="#+id/tv_order_vat"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
</TableLayout>
I think your code it's fine, and this one will improve for your code better.
Just using gravity:right if you wanna put it on the right.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="asd"
android:gravity="left"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_order_tin_ein"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="Test" />
</LinearLayout>
Try this :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Text1"
android:layout_weight="1"/>
<TextView
android:text="Text2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>

Contents in ListView not centered

My app retrieves user details from DB and displays in the ListView. However the contents displayed in the ListView are not formatted properly.
This is how my layout is currently rendered:
This is my layout file for the activity:
<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:background="#000000"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context=".LeaderBoard" >
<LinearLayout
android:id="#+id/column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/column_header1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="#string/strLBoardHeaderRank"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="#+id/column_header2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:text="#string/strLBoardHeaderName"
android:layout_gravity="center"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="#+id/column_header3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="#string/strLBoardHeaderScore"
android:textColor="#f00"
android:textSize="24sp" />
</LinearLayout>
<ListView
android:id="#+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/column" >
</ListView>
</RelativeLayout>
The layout file for the list activity is below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000" >
<TextView
android:id="#+id/rank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="#+id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:textColor="#f00"
android:textSize="20sp" />
</LinearLayout>
add android:gravity="center" for all textviews and layout file for the list activity textviews width should be 0dp because of weight property and u should also add android:orientation="horizontal"
<TextView
android:id="#+id/column_header1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:gravity="center"
android:text="strLBoardHeaderRank"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="#+id/column_header2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center"
android:text="strLBoardHeaderName"
android:layout_gravity="center"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="#+id/column_header3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:gravity="center"
android:text="strLBoardHeaderScore"
android:textColor="#f00"
android:textSize="24sp" />
layout file for the list
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="horizontal" >
<TextView
android:id="#+id/rank"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:gravity="center"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="#+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:gravity="center"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="#+id/score"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:gravity="center"
android:textColor="#f00"
android:textSize="20sp" />
</LinearLayout>
Try this one, this worked for me
//Main Layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="horizontal" >
<TableLayout
android:id="#+id/add_rule_table"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_marginTop="5dp"
android:background="#color/list_divider"
android:orientation="vertical"
android:stretchColumns="*"
android:visibility="gone" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:ems="4"
android:gravity="center"
android:text="#string/rule_no"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:ems="4"
android:gravity="center"
android:text="#string/lot"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:ems="4"
android:gravity="center"
android:text="#string/discount"
android:textSize="12sp"
android:textStyle="bold" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
</TableLayout>
<ListView
android:id="#+id/rule_list_view"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_weight="1"
android:background="#android:color/transparent"
android:cacheColorHint="#00000000"
android:choiceMode="none"
android:listSelector="#android:color/transparent" />
</LinearLayout>
//Custom List View Items
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
>
<TableLayout
android:id="#+id/add_rule_table"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:layout_marginTop="5dp"
android:background="#color/white"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:orientation="horizontal" >
<TextView
android:id="#+id/rule_nos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginRight="1dp"
android:ems="3"
android:gravity="center_horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="1"
android:textSize="12sp" />
<TextView
android:id="#+id/lots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="4"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="23"
android:textSize="12sp" />
<TextView
android:id="#+id/discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="4"
android:gravity="center"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="34%"
android:textSize="12sp" />
<TextView
android:id="#+id/edit_rule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/edit_rule"
android:ems="4"
android:gravity="center_horizontal"
android:text="#string/edit"
android:textColor="#ffffff"
android:textSize="12sp" />
<TextView
android:id="#+id/delete_rule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:background="#drawable/delete_rule"
android:ems="4"
android:gravity="center_horizontal"
android:text="#string/delete"
android:textColor="#ffffff"
android:textSize="12sp" />
</TableRow>
</TableLayout>
</LinearLayout>

How to Bypass the Inconsistent DatePicker Widget in ICS and Jellybean

I am using Datepicker in Android. I get a tottaly Bizzare UI in Jellybean.
Here is the Layout Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/stores"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner_sales_store"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/products"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner_sales_product"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/quantities"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner_sales_quantity"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/textView4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView_sales_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="------"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/textView5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="No of Items"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/txt_sales_num"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="#+id/tableRow6a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<TextView
android:id="#+id/textView6a"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Order Date"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
<TableRow
android:id="#+id/tableRow6b"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<android.widget.DatePicker
android:id="#+id/dpicker_sales_Order_date"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:id="#+id/tableRow7a"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp">
<TextView
android:id="#+id/textView7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Issue Date"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
<TableRow
android:id="#+id/tableRow7b"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<android.widget.DatePicker
android:id="#+id/dpicker_sales_Issue_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</TableRow>
<TableRow
android:id="#+id/tableRow8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<Button
android:id="#+id/btn_sales_save"
style="#style/ButtonStyle_menu"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/custom_button"
android:text="#string/save"
android:onClick="saveClicked_Sales" />
</TableRow>
</TableLayout>
</ScrollView>
Have you experienced any such Issues?
Is there any way to show just the UI as in GingerBread?
There is no code in the Activity. Just the xml codings.
Add android:calendarViewShown="false" to your <DatePicker> element to suppress the calendar, if you do not wish to make room for it.

Categories

Resources