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>
Related
In my xml there are two listviews(Area1 and Area2), there are dynamic elements in Area2 and when I click on any item it should populate in Area1(another listview whose size is always 1). My problem is that itemClickListener is not working.
XML is:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/light_grey"
>
<RelativeLayout
android:id="#+id/top1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/listrow_layerlist_background_dark_purple"
android:padding="10dp" >
<LinearLayout
android:id="#+id/linear_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView_productName_size_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="<Scan or Type a Barcode to see Product
information here>"
android:paddingLeft="5dp"
android:textSize="12dp" />
<LinearLayout
android:id="#+id/linear1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="7dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
android:weightSum="7.5" >
<ToggleButton
android:id="#+id/toggleButton1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="#drawable/bgtoggle"
android:button="#null"
android:checked="true"
android:textOff=""
android:textOn="" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3.5"
android:nextFocusLeft="#+id/editText_Price"
android:nextFocusUp="#+id/editText_Price" >
<EditText
android:id="#+id/editText_barcode"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ems="10"
android:gravity="bottom"
android:hint="Barcode"
android:longClickable="false"
android:singleLine="true"
android:textAppearance="?
android:attr/textAppearanceMedium"
android:textColor="#color/black" >
<requestFocus />
</EditText>
</LinearLayout>
<EditText
android:id="#+id/editText_Price"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:visibility="visible" />
<LinearLayout
android:id="#+id/linear_fetch_barcode_data"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/listrow_layerlist_image"
android:gravity="center_vertical|center_horizontal" >
<ImageView
android:id="#+id/fetch_barcode_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/forward" />
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/align"
android:layout_alignTop="#+id/align"
android:layout_weight="1.5"
android:background="#drawable/camera_new"
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/top"
android:background="#color/dark_color"
android:visibility="visible" >
<!-- <TextView -->
<!-- android:id="#+id/total_scanned_pending_jobs" -->
<!-- android:layout_width="fill_parent" -->
<!-- android:layout_height="fill_parent" -->
<!-- android:layout_margin="5dp" -->
<!-- android:background="#drawable/rounded_edittext" -->
<!-- android:gravity="left" -->
<!-- android:paddingBottom="2dp" -->
<!-- android:paddingLeft="8dp" -->
<!-- android:paddingRight="8dp" -->
<!-- android:paddingTop="2dp" -->
<!-- android:singleLine="true" -->
<!-- android:textColor="#color/black" -->
<!-- android:textSize="11sp" /> -->
<LinearLayout
android:id="#+id/rl_first_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/dark_color"
android:gravity="center"
android:orientation="horizontal"
android:padding="2dp"
android:visibility="visible"
android:weightSum="2" >
<LinearLayout
android:id="#+id/rl_first_block1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#drawable/bg_header_left"
android:orientation="vertical"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="2dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Products:"
android:textAppearance="?
android:attr/textAppearanceSmallInverse"
android:textColor="#color/black"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtProducts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="£ 2221245"
android:textAppearance="?
android:attr/textAppearanceSmallInverse"
android:textColor="#color/black"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/rl_first_block12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Quantity:"
android:textAppearance="?
android:attr/textAppearanceSmallInverse"
android:textColor="#color/black"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtQuantity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="£ 298989"
android:textAppearance="?
android:attr/textAppearanceSmallInverse"
android:textColor="#color/black"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- new -->
<LinearLayout
android:id="#+id/rl_first_block2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#drawable/bg_header_right"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Total (After Discounts)"
android:textColor="#color/black"
android:textSize="11sp"
android:textStyle="bold" />
<TextView
android:id="#+id/totalAmt_after_discounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:text="£ 2343233252"
android:textAppearance="?
android:attr/textAppearanceMedium"
android:textColor="#color/purple"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/rl_bottom_btns"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:weightSum="4" >
<Button
android:id="#+id/btn_total_draft"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:background="#color/darkgrey"
android:orientation="horizontal"
android:text=""
android:textAllCaps="false"
android:textColor="#color/white"
android:textSize="15sp" />
<Button
android:id="#+id/btn_save_draft"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/darkgrey"
android:orientation="horizontal"
android:text="New"
android:textColor="#color/white"
android:textSize="15sp" />
<Button
android:id="#+id/btn_goto_draft"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:background="#color/darkgrey"
android:orientation="horizontal"
android:text="Open"
android:textColor="#color/white"
android:textSize="15sp" />
<Button
android:id="#+id/button_next"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:background="#color/darkgrey"
android:orientation="horizontal"
android:text="Tender"
android:textColor="#color/white"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/linear2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/linear"
android:layout_marginLeft="2dp"
android:orientation="horizontal"
android:visibility="gone" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:background="#android:color/white"
android:enabled="false"
android:gravity="center"
android:text="Barcode"
android:textColor="#android:color/black"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:background="#android:color/white"
android:enabled="false"
android:gravity="center"
android:text="Qty"
android:textColor="#android:color/black"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:background="#android:color/white"
android:enabled="false"
android:gravity="center"
android:text="Area"
android:textColor="#android:color/black"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="1"
android:background="#android:color/white"
android:enabled="false"
android:gravity="center"
android:text="Location"
android:textColor="#android:color/black"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<LinearLayout
android:id="#+id/linear3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/inflated_ll"
android:layout_marginLeft="2dp"
android:orientation="horizontal"
android:visibility="gone"
android:weightSum="4" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="0.6"
android:enabled="false"
android:gravity="left"
android:paddingLeft="3dp"
android:text="Name"
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="1.5"
android:enabled="false"
android:gravity="right"
android:text="Quantity"
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="0.5"
android:enabled="false"
android:gravity="right"
android:text="Price"
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" >
</TextView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:layout_weight="0.6"
android:enabled="false"
android:gravity="center"
android:text="Total"
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<ListView
android:id="#+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/rl_bottom_btns"
android:layout_below="#id/inflated_ll"
android:layout_marginTop="20dp"
android:divider="#null"
android:descendantFocusability="blocksDescendants"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
>
</ListView>
<ListView
android:id="#+id/inflated_ll"
android:layout_width="match_parent"
android:layout_height="86dp"
android:layout_below="#+id/linear"
android:background="#80000000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone" >
</ListView>
</RelativeLayout>
</RelativeLayout>
[enter image description here][1]
If you want to change what data is being displayed in your ListView, you need to call the notifyDataSetChanged() on the adapter which populates your ListView.
So, when the button is clicked, change the data in your adapter and call notifyDataSetChanged()
Try to set
android:descendantFocusability="blocksDescendants">
to the parent layout and set
android:clickable="false"
android:focusable="false">
to all views, that will make the itemClickListener work well.
I am building an app that is in 3 languages. The problem is that the text in textview is not aligning well. See image below -
I have set the gravity to start on all textviews.
I have tried Textview issue with text align, Android: Text in TextView not aligned well, How to align the textview to right in android?
The xml is as follows -
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#F2D77C"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context=".AdActivity" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F2D77C"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F2D77C"
android:visibility="gone"
android:weightSum="2" >
<TextView
android:id="#+id/topCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#F2D77C"
android:paddingBottom="7dp"
android:paddingLeft="5dp" />
<TextView
android:id="#+id/topPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="top|right|end"
android:layout_weight="1"
android:background="#F2D77C"
android:paddingRight="5dp"
android:textAlignment="textEnd"
android:textSize="20sp" />
</LinearLayout>
<!--
<HorizontalScrollView
android:id="#+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
-->
<!-- </HorizontalScrollView> -->
<ImageSwitcher
android:id="#+id/imageSwitcher1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="400dp" >
</ImageSwitcher>
<Gallery
android:id="#+id/gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:spacing="5dp" />
<TextView
android:id="#+id/textViewPrice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F2D77C"
android:padding="5dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#262626" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Ad Code"
android:textStyle="bold"
android:textSize="20sp" />
<TextView
android:id="#+id/adCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Test code"
android:textSize="20sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Viewed"
android:textStyle="bold"
android:textSize="20dp" />
<TextView
android:id="#+id/views"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="0"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:minWidth="50dp"
android:padding="5dp"
android:text="#string/city"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/city"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/date"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/price"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/price"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
</TableLayout>
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#20202020"
android:padding="5dp"
android:text="#string/description"
android:textColor="#6B5F53"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F2E0A7"
android:minHeight="75dp"
android:padding="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#20202020"
android:padding="5dp"
android:text="#string/publisher_details"
android:textColor="#6B5F53"
android:textSize="20sp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp" >
<TableRow
android:padding="5dp"
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="#string/name"
android:textColor="#6B5F53"
android:textStyle="bold" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="TextView"
android:textColor="#999999" />
</TableRow>
</TableLayout>
<Button
android:id="#+id/buttonCallCar"
style="#drawable/button_wh"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:paddingBottom="5dp"
android:text="Call" />
<Button
android:id="#+id/buttonAltCall"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:text="Call" />
<Button
android:id="#+id/buttonFacebook"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:drawableLeft="#drawable/facebook"
android:text="#string/share" />
</LinearLayout>
</ScrollView>
</LinearLayout>
The problem is occurring in Kurdish and Arabic but not in English(see image for English).
In my application screen i'm using table layout.in the table row i have two textview.The width of second textview always going out of screen width.I tried wrap_content,match_parent but not getting how to resolve this.How can i set width to device screen layout width?
xml code-
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/even" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical" >
<TableLayout
android:id="#+id/tableLayoutDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/namerow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
>
<TextView
android:id="#+id/nameText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Name" />
<TextView
android:id="#+id/dname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:background="#android:color/black"
android:text="Name :"
android:textColor="#808080" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
Even after giving 100dp width to TextView its going outof screen
In your case column #0 is OK, so you just have to enable shrink (and stretch too if you like) for column #1:
<TableLayout ...
android:shrinkColumns="1"
android:stretchColumns="1" >
You can have a full explanation in the main documentation:
https://developer.android.com/reference/android/widget/TableLayout.html
Best regards
It may be Android Graphical layout issue. I checked your code in Android View Design. The TextView letters not going Beyond the layout. If you have doubt Set the BackGround to the Text view and see what happened?
use this code : work perfect(replace your code with this and modify as your choice)
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/include1"
android:layout_marginTop="20dp"
android:gravity="top"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="30dp"
android:orientation="horizontal"
android:weightSum="100" >
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Name"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvfullname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text="sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Birthday"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvbirth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text=""
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Gender"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvgender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text=""
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Mobile Number"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvmobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text=""
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Email Id"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvemail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text="sjdhgvfkasvsjdgfjsgdfjhgskdjfgakjsgdflaghdfljashdgfljadgsfjahg"
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="Location"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvlocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text=""
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_marginBottom="6dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:background="#e1e2dd" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_weight="50"
android:gravity="left"
android:text="City"
android:textColor="#454545"
android:textSize="12sp" />
<TextView
android:id="#+id/tvcity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:gravity="left"
android:text=""
android:textColor="#454545"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
see this image :
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 a situation, in that situation one view contain imageviews on upper part and list view in the lower part and when we scrolling it is only scroll listview part but i have to scroll whole view simultaneously with single scroll.
I have used add header functionality of list view but in that i have to put seperate xml file of imageview and listview and i need to put them in one xml file. how can i do it..
<ViewFlipper
android:id="#+id/viewFlipper"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/header_relativelayout" >
<!-- //settings First view Setting -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="3dp"
android:paddingRight="3dp" >
<LinearLayout
android:id="#+id/first_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_cbk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/cbk_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_cfb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/cfb_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_mlb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/mlb_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="10sp"
android:textStyle="bold"
android:visibility="invisible" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nba"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nba_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nfl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nfl_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="20sp"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView_nhl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/nhl_btn" />
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="d"
android:textColor="#color/gray"
android:textSize="10sp"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="12sp"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:id="#+id/middle_line"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/first_view"
android:orientation="vertical" >
<ImageView
android:id="#+id/small_line"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="#drawable/small_line" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="f"
android:textColor="#color/gray"
android:textSize="5sp"
android:visibility="invisible" />
</LinearLayout>
<LinearLayout
android:id="#+id/list_header_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/middle_line" >
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="dd"
android:textColor="#color/gray"
android:textSize="14sp"
android:visibility="invisible" />
<TextView
android:id="#+id/list_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Recent Activities"
android:textColor="#color/gray"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/list_header_layout" >
<ExpandableListView
android:id="#id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/first_view"
android:cacheColorHint="#00000000"
android:childDivider="#android:color/black"
android:divider="#android:color/black"
android:fadingEdge="none"
android:scrollingCache="false" >
</ExpandableListView>
</LinearLayout>
</RelativeLayout>
//settings Second view Setting
<RelativeLayout
android:id="#+id/progressrelative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal" >
<ProgressBar
android:id="#+id/progressbar2"
style="#android:style/Widget.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:indeterminate="true"
android:visibility="gone" />
<ListView
android:id="#+id/channellist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/frameLayout"
android:layout_below="#+id/header_relativelayout"
android:cacheColorHint="#00000000"
android:divider="#android:color/transparent"
android:fadingEdge="none"
android:scrollingCache="false" >
</ListView>
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="#+id/betView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="8dp" >
<TextView
android:id="#+id/textView_chooseteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="#string/Games_Placebet_chooseteam"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/gm4_headar_parch"
android:gravity="center" >
<TextView
android:id="#+id/button_date_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:text="Saturday, 10/27/2012 at 01:00 PM"
android:textColor="#color/white"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="-5dp"
android:background="#drawable/gm4_1white_bg"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<TextView
android:id="#+id/button_hometeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:clickable="true"
android:text="Denver Broncos"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView_button_hometeam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="#drawable/game_click_btn" />
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="#drawable/recent_bigpatch_line" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<TextView
android:id="#+id/button_visitorteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="SD Chargers"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView_button_visitorteam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="#drawable/game_unclick_btn" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:text="Betting Amount"
android:textColor="#color/gray"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/upper_relative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/gm4_headar_parch"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:paddingRight="8dp" >
<TextView
android:id="#+id/textView_placebet_balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:paddingTop="2dp"
android:text="#string/Games_Placebet_balance"
android:textColor="#android:color/white"
android:textSize="16sp"
android:textStyle="bold" />
<!--
<TextView
android:id="#+id/textView_placebet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="32dp"
android:paddingTop="4dp"
android:text="$"
android:textColor="#android:color/white"
android:textStyle="bold" />
-->
<TextView
android:id="#+id/textView_placebet_dollar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingTop="4dp"
android:text="100"
android:textColor="#android:color/white"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="-5dp"
android:background="#drawable/gm4_1white_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp" >
<TextView
android:id="#+id/button_placebet_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Denver Broncos"
android:textColor="#color/gray"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#drawable/recent_bigpatch_line" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="3dp"
android:layout_marginTop="10dp" >
<Button
android:id="#+id/button_placebet_up_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="#drawable/pg_2_up_arrow_btn" />
<Button
android:id="#+id/textview_placebet_counter_digipanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:background="#drawable/counter_digitaldisplay"
android:textColor="#109EE6" />
<Button
android:id="#+id/button_placebet_counter_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:background="#drawable/pg_2_down_arrow_btn" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="vertical" >
<Button
android:id="#+id/button_betaganist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#drawable/bet_against_btn_new"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="5dp"
android:text="#string/Games_Placebet_betaganist"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="#+id/button_placebet"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#drawable/placebet_btn_new"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="5dp"
android:text="Place Bet"
android:textColor="#android:color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ListView
android:id="#+id/friendlist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/frameLayout"
android:layout_below="#+id/header_relativelayout"
android:cacheColorHint="#00000000"
android:divider="#android:color/transparent"
android:fadingEdge="none"
android:scrollingCache="false" >
</ListView>
</ViewFlipper>
here is a code of xml file in which i have used viewflipper and in that i have added views so the first view is image view on upper side listview on the lower side when we click on image view next view will flip and so on... but in the first view it is scrolling only listview part i need to scroll whole view with single scroll.
THanks in advance..
The issue is, all the possible ways to mix in two scrolls does not yield well ( to best of my knowledge), Setting the header xml is probably the best approach for it. try to find a way around the situation.