I can't get the bottom row below to center, specifically the columns with integers.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/Row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:padding="10dip" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/player_profile"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:id="#+id/player_number"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/player_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1" >
<TableRow
android:id="#+id/statistics_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="1dip"
android:gravity="center_horizontal">
<TextView
android:id="#+id/statistic_points"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_rebounds"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_assists"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_steals"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_blocks"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_turnovers"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:layout_weight="1" />
</TableRow>
</TableLayout>
</LinearLayout>
try this..
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/player_profile"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip" >
<TextView
android:id="#+id/player_number"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/player_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1" >
<TableRow
android:id="#+id/statistics_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="1dip"
android:gravity="center_horizontal">
<TextView
android:id="#+id/statistic_points"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_rebounds"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_assists"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_steals"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_blocks"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_turnovers"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center_horizontal"
android:layout_weight="1" />
</TableRow>
</TableLayout>
Changed android:layout_gravity="center_horizontal" to android:gravity="center_horizontal"
It's not clear which row you're unhappy with, but realize that there are 2 different gravity attributes. layout_gravity positions the view that it's defined in, while gravity positions items within that view. For layouts, it positions the views within it; for views such as TextViews it positions the text within the view.
Try that:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/player_profile"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:padding="5dip" >
<TextView
android:id="#+id/player_number"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/player_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1" >
<TableRow
android:id="#+id/statistics_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="1dip"
android:gravity="center_horizontal">
<TextView
android:id="#+id/statistic_points"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_rebounds"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_assists"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_steals"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_blocks"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
<TextView
android:id="#+id/statistic_turnovers"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:textAlignment="center"
android:gravity="center"
android:layout_weight="1" />
</TableRow>
</TableLayout>
Related
I am a beginner and I have designed a layout that displays the rows from the XML upon the click of a "show" Button.
But when I don't click the show button, I want the table row with id-blank to increase its height to fit the screen.
Please suggest a way to do that.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- Row 1 with single column -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/White"
android:gravity="center_horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Sale Report"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<!-- Row 2 with 3 columns -->
<LinearLayout
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#drawable/borders"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp" >
<EditText
android:id="#+id/starttime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:inputType="none"
android:textSize="#dimen/textSize" />
<EditText
android:id="#+id/stoptime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:inputType="none"
android:textSize="#dimen/textSize" />
<Button
android:id="#+id/show"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight=".75"
android:text="show" />
<Button
android:id="#+id/back"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight=".75"
android:text="back" />
</LinearLayout>
<!-- Row 3 with 2 columns -->
<TableLayout
android:id="#+id/sale_table_data"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dp"
android:background="#drawable/borders"
android:gravity="center" >
<TableRow
android:id="#+id/sale_report_header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/Yellow" >
<TextView
android:id="#+id/particulars"
android:layout_weight="2"
android:gravity="center_horizontal"
android:text="Particulars"
android:textStyle="bold" />
<TextView
android:id="#+id/voucherNo"
android:layout_weight="1"
android:gravity="fill_horizontal"
android:text="VCH No"
android:textStyle="bold" />
<TextView
android:id="#+id/quantity"
android:layout_weight="1"
android:gravity="fill_horizontal"
android:text="Quantity"
android:textStyle="bold" />
<TextView
android:id="#+id/amount"
android:layout_weight="2"
android:gravity="center_horizontal"
android:text="Amount"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_weight="1.3"
android:gravity="center_horizontal"
android:text="Date"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/blank"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3" >
<TextView
android:id="#+id/blank9"
android:layout_weight="2"
android:gravity="center_horizontal"
android:text="Particulars"
android:textStyle="bold" />
<TextView
android:id="#+id/blank10"
android:layout_weight="1"
android:gravity="fill_horizontal"
android:text="VCH No"
android:textStyle="bold" />
<TextView
android:id="#+id/blank11"
android:layout_weight="1"
android:gravity="fill_horizontal"
android:text="Quantity"
android:textStyle="bold" />
<TextView
android:id="#+id/blank12"
android:layout_weight="2"
android:gravity="center_horizontal"
android:text="Amount"
android:textStyle="bold" />
<TextView
android:id="#+id/blank13"
android:layout_weight="1.3"
android:gravity="center_horizontal"
android:text="Date"
android:textStyle="bold" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/no_borders" >
<TextView
android:id="#+id/blank1"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textStyle="bold" />
<TextView
android:id="#+id/blank2"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textStyle="bold" />
<TextView
android:id="#+id/Total"
android:layout_weight="1"
android:gravity="center"
android:text="Total"
android:textStyle="bold" />
<TextView
android:id="#+id/total_sales"
android:layout_weight="2"
android:gravity="center_horizontal"
android:text="Amount_value"
android:textStyle="bold" />
<TextView
android:id="#+id/blank3"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textStyle="bold" />
</TableRow>
</TableLayout>
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
I have my layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearlayout01"
android:layout_width="300dp"
android:layout_height="45dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="52dp"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="#+id/Btn"
android:background="#drawable/close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-2dp"
android:layout_marginTop="10dp">
</Button>
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:shrinkColumns="1"
android:stretchColumns="0"
android:layout_marginTop="15dp" >
<TableRow android:weightSum="2" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text="#string/HostName"
android:textColor="#000000"
android:textStyle="bold" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_weight="0"
android:textColor="#000000"
android:textStyle="bold" />
</TableRow>
<TableRow android:weightSum="2"
android:layout_marginTop="30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text="#string/programname"
android:textColor="#000000"
android:textStyle="bold" />
<TextView
android:id="#+id/programname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:textColor="#000000"
android:textStyle="bold" />
</TableRow>
<TableRow android:weightSum="2"
android:layout_marginTop="30dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text="#string/Date"
android:textColor="#000000"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:textColor="#000000"
android:textStyle="bold" />
</TableRow>
<TableRow android:layout_marginTop="20dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
>
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/mainlayout"
android:layout_marginLeft="-260dp"
android:layout_marginRight="0dp"
android:layout_marginTop="8dp" />
</TableRow>
</TableLayout>
</LinearLayout>
and I got the following output:
Update:
But my required output should be:
| HostName: text123 |
| PName: text3 |
| Date: text6 |
Could any one help?
String, try with this. I have attached the output too. I don't get any irregular text-alignments as I have shown in the below pic.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearlayout01"
android:layout_width="300dp"
android:layout_height="45dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="52dp"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="#+id/Btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-2dp"
android:layout_marginTop="10dp"
android:text="close">
</Button>
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_marginTop="15dp" >
<TableRow
android:id="#+id/tableRow1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:weightSum="2">
<TextView
android:id="#+id/TextView04"
android:text="Date"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
<TextView
android:id="#+id/TextView04"
android:text="text123"
android:textStyle="bold"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:weightSum="2">
<TextView
android:id="#+id/TextView04"
android:text="Date"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
<TextView
android:id="#+id/TextView04"
android:text="text123"
android:textStyle="bold"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:weightSum="2">
<TextView
android:id="#+id/TextView04"
android:text="Date"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
<TextView
android:id="#+id/TextView04"
android:text="text123"
android:textStyle="bold"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:weightSum="2">
<TextView
android:id="#+id/TextView04"
android:text="Date"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
<TextView
android:id="#+id/TextView04"
android:text="text123"
android:textStyle="bold"
android:layout_width="0dp"
android:layout_weight="1"></TextView>
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/mainlayout"
android:layout_marginLeft="-260dp"
android:layout_marginRight="0dp"
android:layout_marginTop="8dp" />
</TableRow>
</TableLayout>
</LinearLayout>
Output:
Post back if you have any issues.
Better try this ..
<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" >
<LinearLayout
android:id="#+id/rows"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout
android:id="#+id/key"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp" >
<TableRow
android:id="#+id/row1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="HName" />
<TextView
android:id="#+id/txt2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="HostName" />
</TableRow>
<TableRow
android:id="#+id/row2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp" >
<TextView
android:id="#+id/txt3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="PName" />
<TextView
android:id="#+id/txt4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="ProgramName" />
</TableRow>
<TableRow
android:id="#+id/row3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp" >
<TextView
android:id="#+id/txt5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date" />
<TextView
android:id="#+id/txt6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Todays Date" />
</TableRow>
</TableLayout>
</LinearLayout>
</RelativeLayout>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:weightSum="2" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text="Date"
android:textColor="#ffffff"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="text123"
android:textColor="#ffffff"
android:textStyle="bold" />
</TableRow>
You must give android:layout_weight for both TextView in a TableRow equally . I think it will solve your issue
EDIT :
I just give simple modifications in your xml code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearlayout01"
android:layout_width="300dp"
android:layout_height="45dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="52dp"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="#+id/Btn"
android:background="#drawable/close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-2dp"
android:layout_marginTop="10dp">
</Button>
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:shrinkColumns="1"
android:stretchColumns="0"
android:layout_marginTop="15dp" >
<TableRow android:weightSum="2" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text="HostName"
android:textColor="#ffffff"
android:textStyle="bold" />
<TextView
android:id="#+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_weight="1"
android:text="HostName"
android:textColor="#ffffff"
android:textStyle="bold" />
</TableRow>
<TableRow android:weightSum="2"
android:layout_marginTop="30dp"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text=" programname"
android:textColor="#ffffff"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text=" programname"
android:layout_weight="1"
android:textColor="#ffffff"
android:textStyle="bold" />
</TableRow>
<TableRow android:weightSum="2"
android:layout_marginTop="30dp"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:text=" Date"
android:textColor="#ffffff"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text=" date"
android:layout_weight="1"
android:textColor="#ffffff"
android:textStyle="bold" />
</TableRow>
<TableRow android:layout_marginTop="20dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
>
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/mainlayout"
android:layout_marginLeft="-260dp"
android:layout_marginRight="0dp"
android:layout_marginTop="8dp" />
</TableRow>
</TableLayout>
</LinearLayout>
Screen shot after my modification
Is this you want ??
I have this xml layout code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:background="#FFFFFF">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/nektaText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="10pt"
android:textAlignment="center"
android:text="example text will not be used" />
<ImageView
android:id="#+id/horilinee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:src="#drawable/horiline" />
<TableRow
android:id="#+id/table"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom" >
<Button
android:id="#+id/send"
android:text="أرسل"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<EditText
android:id="#+id/commenttext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="اكتب التعليق هنا"
android:minLines="1"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:scrollHorizontally="true"
android:scrollbars="vertical"
android:layout_weight="1"
android:singleLine="false" />
</TableRow>
<ImageView
android:id="#+id/horilineee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:src="#drawable/horiline" />
<ListView
android:id="#id/android:list"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
android:paddingLeft="5dp"
android:paddingRight="5dp" />
</TableLayout>
</ScrollView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal" >
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="#+id/tableRow0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<ImageView
android:id="#+id/horiline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/horiline" />
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom" >
<ImageView
android:id="#+id/share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/share" />
<ImageView
android:id="#+id/block"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/block" />
<ImageView
android:id="#+id/thumbdown"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/thumbdown" />
<ImageView
android:id="#+id/thumbup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/thumbup" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom" >
<TextView
android:id="#+id/sharetext"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="شارك"
android:textSize="12dp" />
<TextView
android:id="#+id/blocktext"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="إبلاغ إساءة"
android:textSize="12dp" />
<TextView
android:id="#+id/dislikenumber"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textColor="#FF0000"
android:textSize="12dp" />
<TextView
android:id="#+id/likenumber"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textColor="#00FF00"
android:textSize="12dp" />
</TableRow>
</TableLayout>
</LinearLayout>
</RelativeLayout>
but it doesn't seems to be working as I want it to be. I need it like the following figure:
The problem with my code is the list view I can't stretch it to the bottom before the tablelayout. The other problem comes if the textview at the top is too long, it appears under the tablelayout and it's visible.
Also the tablelayout at the bottom shifted up when the keyboard is visible, I don't want this to happen.
Any suggestion please?
Have a single ListView in your layout. You can add other views(as shown in your diagram) as headers to the list view using addHeaderView() method. This way you will get the Scrolling effect as you desired.
Thank you all for your support. I came up with a better solution:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_weight="1" >
<TextView
android:id="#+id/nektaText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="example text will not be used"
android:textAlignment="center"
android:textSize="10pt" />
</ScrollView>
<ImageView
android:id="#+id/horilinee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:src="#drawable/horiline" />
<TableRow
android:id="#+id/table"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:gravity="bottom" >
<Button
android:id="#+id/send"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="أرسل" />
<EditText
android:id="#+id/commenttext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="اكتب التعليق هنا"
android:minLines="1"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:scrollHorizontally="true"
android:scrollbars="vertical"
android:singleLine="false" />
</TableRow>
<ImageView
android:id="#+id/horilineee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:src="#drawable/horiline" />
<ListView
android:id="#id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:drawSelectorOnTop="false"
android:paddingLeft="5dp"
android:paddingRight="5dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/layout0"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="end" >
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="#+id/tableRow0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom"
android:paddingBottom="10dp"
android:paddingTop="10dp" >
<ImageView
android:id="#+id/horiline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/horiline" />
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom" >
<ImageView
android:id="#+id/share"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/share" />
<ImageView
android:id="#+id/block"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/block" />
<ImageView
android:id="#+id/thumbdown"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/thumbdown" />
<ImageView
android:id="#+id/thumbup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/thumbup" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="bottom" >
<TextView
android:id="#+id/sharetext"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="شارك"
android:textSize="12dp" />
<TextView
android:id="#+id/blocktext"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="إبلاغ إساءة"
android:textSize="12dp" />
<TextView
android:id="#+id/dislikenumber"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textColor="#FF0000"
android:textSize="12dp" />
<TextView
android:id="#+id/likenumber"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textColor="#00FF00"
android:textSize="12dp" />
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
ScrollView needs to declare :
android:layout_above="#+id/Layout1"
Layout1 is the layout that host tableLayout1
But you will have some issues with ListView into scrollView
As there are only two Layout in your RelativeLayout, use LinearLayout. This will solve the overlap problem. Set the weight of ScrollView to keep the TableLayout at bottom.
The keyboard shift the Bottom table layout because it's mode is set to Resize. You will usually control this behavior through the android:windowSoftInputMode attribute on each definition in your AndroidManifest.xml. Set the value of this to adjustPan.
i have a layout having many fields and i wish to add scrollbars for both horizontal and vertical layout.But vertical scroll is working horizontal scroll is not working.I have loaded the text fields dynamically in program and add the fields with web service .
My Activity
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/LayoutScroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="horizontal|vertical" >
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="30dp"
android:gravity="fill|fill_horizontal"
android:orientation="vertical" >
<TableRow
android:id="#+id/Row_User_Deletion"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DF0101"
android:gravity="center" >
<TextView
android:id="#+id/user_creation_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/txt_delete_user_userDeletion"
android:textColor="#color/white"
android:textSize="15dp" />
</TableRow>
<TableRow
android:id="#+id/RowUserType"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/txt_delete_user_selectuserType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/txt_delete_user_selectuserType"
android:textColor="#424242" />
<Spinner
android:id="#+id/spin_delete_userType"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:entries="#array/utype" />
<Button
android:id="#+id/btn_spinner_user_search_select"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="5dp"
android:background="#drawable/redbtn"
android:text="#string/btn_delete_user_search_user" />
</TableRow>
<TableRow
android:id="#+id/deleteUserRow"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="10dp"
android:gravity="fill" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/txt_user_creation_userId"
android:textColor="#424242" />
<EditText
android:id="#+id/txt_user_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="#drawable/redbtn"
android:text="#string/btn_delete_user_search_user" />
</TableRow>
<TableLayout
android:id="#+id/delete_userDetails_Table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:background="#color/red" >
<TextView
android:id="#+id/textView2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_delete_user_select"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView3"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_user_creation_userId"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView4"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_user_creation_userName"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_delete_user_UserRole"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/txt_componentmaster_createdDate"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/txt_componentmaster_createdBy"
android:textColor="#color/white" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
ImageView
Please keep in mind that the view that you want to scroll Horizontal is must have LinearLayout as parent then only you can set the HorizontalScrollView between that layout.
And Put one HorizontalScrollView as the Parent of those both LinearLayout.
Hope this will help you.
Smple:
<HORIZONTAL_VIEW ... >
<!-- Your First Layout -->
<LinearLayout ... >
</LinearLayout>
<!-- Your Second Layout -->
<LinearLayout ... >
</LinearLayout>
</HORIZONTAL_VIEW ... >
Hope you got my point.
Feel free for any query. :)
Try the Scroll Bars with out the Scrollview..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="30dp"
android:gravity="fill|fill_horizontal"
android:scrollbars="horizontal|vertical"
android:orientation="vertical" >
<TableRow
android:id="#+id/Row_User_Deletion"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DF0101"
android:gravity="center" >
<TextView
android:id="#+id/user_creation_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/txt_delete_user_userDeletion"
android:textColor="#color/white"
android:textSize="15dp" />
</TableRow>
<TableRow
android:id="#+id/RowUserType"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/txt_delete_user_selectuserType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/txt_delete_user_selectuserType"
android:textColor="#424242" />
<Spinner
android:id="#+id/spin_delete_userType"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:entries="#array/utype" />
<Button
android:id="#+id/btn_spinner_user_search_select"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="5dp"
android:background="#drawable/redbtn"
android:text="#string/btn_delete_user_search_user" />
</TableRow>
<TableRow
android:id="#+id/deleteUserRow"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="10dp"
android:gravity="fill" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/txt_user_creation_userId"
android:textColor="#424242" />
<EditText
android:id="#+id/txt_user_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="#drawable/redbtn"
android:text="#string/btn_delete_user_search_user" />
</TableRow>
<TableLayout
android:id="#+id/delete_userDetails_Table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:background="#color/red" >
<TextView
android:id="#+id/textView2"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_delete_user_select"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView3"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_user_creation_userId"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView4"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_user_creation_userName"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="#string/txt_delete_user_UserRole"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/txt_componentmaster_createdDate"
android:textColor="#color/white" />
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/txt_componentmaster_createdBy"
android:textColor="#color/white" />
</TableRow>
</TableLayout>
</LinearLayout>
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.