When I have an application filled with text, when I scroll down to see the end of the text, it must show me a background at the end .. I wrote this but it shows the background in the middle - I think
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/bglow"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dip"
android:gravity="bottom" />
How can I put a background at the end?
Edited
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:gravity="center" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/bglow"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dip"
android:gravity="bottom" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="vertical"
android:textStyle="italic" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="7sp" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/1" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="15sp" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/logoline" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="5sp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:textStyle="italic"
android:weightSum="100" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="60"
android:gravity="center"
android:src="#drawable/2" />
<Button
android:id="#+id/h"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="40"
android:background="#drawable/buttoncolor"
android:gravity="left"
android:text="H"
android:textColor="#AD9C64"
android:textSize="25sp"
android:textStyle="italic"
android:typeface="serif" />
</LinearLayout>
</ScrollView>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="15sp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:textStyle="italic"
android:weightSum="100" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="60"
android:gravity="center"
android:src="#drawable/3" />
<Button
android:id="#+id/r"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="40"
android:background="#drawable/buttoncolor"
android:gravity="left"
android:text="R"
android:textColor="#AD9C64"
android:textSize="25sp"
android:textStyle="italic"
android:typeface="serif" />
</LinearLayout>
</ScrollView>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="15sp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:textStyle="italic"
android:weightSum="100" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="60"
android:gravity="center"
android:src="#drawable/4" />
<Button
android:id="#+id/4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="40"
android:background="#drawable/buttoncolor"
android:gravity="left"
android:text="D"
android:textColor="#AD9C64"
android:textSize="22sp"
android:textStyle="italic"
android:typeface="serif" />
</LinearLayout>
</ScrollView>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="7sp" />
<Button
android:id="#+id/ab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/buttoncolor"
android:gravity="center"
android:text="About"
android:textColor="#AD9C64"
android:textSize="10sp"
android:textStyle="italic"
android:typeface="serif" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text=""
android:textSize="7sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
Related
I have a SlidingDrawer. And I want use ScrollView in my SlidingDrawer. I Try but app is not running.
I am tried ScrollView in LinearLayout but still not running app.
How can I do this.
Here İs Code:
.
.
.
.
.
.
<LinearLayout
android:id="#+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<SlidingDrawer
android:layout_width="wrap_content"
android:layout_height="330dp"
android:content="#+id/content"
android:handle="#+id/handle"
android:id="#+id/slidingDrawer"
android:layout_gravity="center_horizontal"
android:padding="10dip">
<Button
android:id="#+id/handle"
android:layout_width="200dp"
android:layout_height="33dp"
android:text="== ÇÖZÜM =="
android:textSize="10dp"/>
<!-- I Try Add LinearLayout here But still not ronning.-->
<ScrollView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ababab"
android:gravity="center|top"
android:padding="10dip">
.
.
.
.
.
.
</ScrollView>
</SlidingDrawer>
</LinearLayout>
THANKS!
This is my layout design that i had used in one of my project and it worked perfect check this :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.wholesaleraja.touch_image.TouchImageZoom
android:id="#+id/singe_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:src="#drawable/raja" />
<RelativeLayout
android:id="#+id/det"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/single_item_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="5dp"
android:text="Single Name"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:id="#+id/view"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/single_item_text"
android:background="#color/list_divider" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view"
android:orientation="horizontal" >
<TextView
android:id="#+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Product Code : "
android:textColor="#000000"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/code_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="#000000"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="#+id/price_tag"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/price_button_background"
android:clickable="false"
android:padding="5dp"
android:text="Price"
android:textColor="#ffffff" />
</RelativeLayout>
<SlidingDrawer
android:id="#+id/SlidingDrawer"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:layout_alignParentBottom="true"
android:content="#+id/contentLayout"
android:handle="#+id/slideButton"
android:orientation="vertical"
android:padding="0dip"
android:rotation="0" >
<ImageView
android:id="#+id/slideButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/up" />
<ScrollView
android:id="#+id/contentLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#e5e5e5" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="7dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lot Size : "
android:textSize="15sp" />
<TextView
android:id="#+id/lot_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 "
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Piece(s)/Lot"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp" >
<TableLayout
android:id="#+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/row3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Lot(s) "
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Discount"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Price/Lot"
android:textSize="22sp" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Lot Qty : "
android:textSize="18sp" />
<Button
android:id="#+id/minus"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="#drawable/round_button"
android:text="-"
android:textSize="30sp"
android:textStyle="bold" />
<EditText
android:id="#+id/count"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/round_edittext"
android:focusable="false"
android:gravity="center"
android:inputType="number" >
</EditText>
<Button
android:id="#+id/plus"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#drawable/round_button"
android:text="+"
android:textSize="30sp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="#+id/addtocart"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:background="#drawable/cart_button_background"
android:padding="5dp"
android:text="Add to Cart"
android:textColor="#ffffff" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="7dp"
android:text="Description"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:layout_width="fill_parent"
android:layout_height="1.5dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/full_desc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:padding="5dp"
android:paddingBottom="5dp"
android:textSize="15sp" />
</LinearLayout>
</ScrollView>
</SlidingDrawer>
</RelativeLayout>
</FrameLayout>
First of all, I know it's not good to keep the mapview or listview inside the scrollview. But i wish to design the page like the following.
I tried setListViewHeightBasedOnchildren method. It is sluggish as my listview is dynamic. The mapview, I can't scroll up and down and it's flickering when i am scrolling.
What is the best way to do this?
Can i add all the view as my listview header? The mapview is heavy!! Can i add that view as header to the listview?
Here is the source code :
<?xml version="1.0" encoding="utf-8"?>
<include
android:id="#+id/bottomMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="#layout/bottom_menu" />
<include
android:id="#+id/topMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="#layout/top_menu" />
<ScrollView
android:id="#+id/mainScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/bottomMenu"
android:layout_below="#id/topMenu"
android:fadingEdge="vertical"
android:fadingEdgeLength="20dip"
android:fillViewport="true"
android:scrollbars="none" >
<TableLayout
android:id="#+id/linearShopInfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- Images and its header -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dip" >
<ImageView
android:id="#+id/imgStoreImage"
android:layout_width="150dip"
android:layout_height="165dip"
android:adjustViewBounds="true"
android:background="#drawable/rounded_white_border"
android:contentDescription="#string/app_name"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center"
android:orientation="vertical" >
<!-- style="#style/CustomRatingBar" -->
<RatingBar
android:id="#+id/ratingShops"
style="#style/CustomRatingBar"
android:layout_width="wrap_content"
android:layout_height="25dip"
android:layout_margin="5dip"
android:clickable="false"
android:focusable="false"
android:isIndicator="true"
android:numStars="5"
android:stepSize="0.5" />
<TextView
android:id="#+id/txtReviewCount"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:singleLine="true"
android:textColor="#color/black" />
<CheckBox
android:id="#+id/chkFavoriteShop"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:button="#drawable/icon_star_empty"
android:drawablePadding="5dip"
android:text="#string/favorite_store" />
<TextView
android:id="#+id/txtConnect"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:singleLine="true"
android:text="#string/share"
android:textColor="#color/black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="horizontal" >
<ImageView
android:id="#+id/btnFaceBook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:contentDescription="#string/app_name"
android:padding="3dip"
android:src="#drawable/icon_facebook" />
<ImageView
android:id="#+id/btnTwitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:contentDescription="#string/app_name"
android:padding="3dip"
android:src="#drawable/icon_twitter" />
<ImageView
android:id="#+id/btnGooglePlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:contentDescription="#string/app_name"
android:padding="3dip"
android:src="#drawable/icon_google_plus" />
<ImageView
android:id="#+id/btnShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:contentDescription="#string/app_name"
android:padding="3dip"
android:src="#drawable/icon_share" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dip"
android:layout_marginTop="2dip"
android:background="#drawable/line" />
<TextView
android:id="#+id/txtAboutStoreCaption"
style="#android:style/TextAppearance.Large"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:singleLine="true"
android:text="#string/about_the_store"
android:textColor="#color/black" />
<TextView
android:id="#+id/txtAboutStore"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:textColor="#color/black" />
<View
android:layout_width="fill_parent"
android:layout_height="3dip"
android:layout_marginTop="2dip"
android:background="#drawable/line" />
<TextView
android:id="#+id/txtMapAndLocationCaption"
style="#android:style/TextAppearance.Large"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:singleLine="true"
android:text="#string/map_and_location"
android:textColor="#color/black" />
<FrameLayout
android:id="#+id/mMapFrame"
android:layout_width="fill_parent"
android:layout_height="230dip" >
<android.support.v4.view.ViewPager
android:id="#+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v4.view.ViewPager>
<fragment
android:id="#+id/mMapView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
class="com.google.android.gms.maps.SupportMapFragment"
android:background="#android:color/transparent" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent" />
</FrameLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dip"
android:layout_marginTop="2dip"
android:background="#drawable/line" />
<TextView
android:id="#+id/txtShopAddress"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dip"
android:singleLine="true"
android:text="#string/coupons"
android:textColor="#color/black" />
<View
android:layout_width="fill_parent"
android:layout_height="3dip"
android:layout_marginTop="2dip"
android:background="#drawable/line" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dip"
android:layout_marginTop="4dip"
android:orientation="horizontal"
android:padding="3dip" >
<TextView
android:id="#+id/txtShopWebAddress"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="#drawable/icon_mouse"
android:drawablePadding="4dip"
android:gravity="center"
android:padding="5dip"
android:paddingLeft="25dip"
android:singleLine="true"
android:text="#string/view_website"
android:textColor="#color/blue" />
<View
android:layout_width="2dip"
android:layout_height="30dip"
android:layout_marginTop="2dip"
android:background="#color/blue" />
<TextView
android:id="#+id/txtShopNumber"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="#drawable/icon_phone"
android:drawablePadding="4dip"
android:gravity="center"
android:padding="5dip"
android:paddingLeft="25dip"
android:singleLine="true"
android:textColor="#color/blue" />
</LinearLayout>
<LinearLayout
android:id="#+id/linOffers"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/txtRewards"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/dark_grey"
android:gravity="center"
android:paddingBottom="12dip"
android:paddingTop="12dip"
android:text="#string/rewards"
android:textColor="#color/white" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="#color/black" />
<TextView
android:id="#+id/txtDeals"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/dark_grey"
android:gravity="center"
android:paddingBottom="12dip"
android:paddingTop="12dip"
android:text="#string/deals"
android:textColor="#color/white" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="#color/black" />
<TextView
android:id="#+id/txtCoupons"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/dark_grey"
android:gravity="center"
android:paddingBottom="12dip"
android:paddingTop="12dip"
android:singleLine="true"
android:text="#string/coupons"
android:textColor="#color/white" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="#color/black" />
<TextView
android:id="#+id/txtGiftCards"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/grey_deep_dark"
android:gravity="center"
android:paddingBottom="12dip"
android:paddingTop="12dip"
android:singleLine="true"
android:text="#string/gift_cards"
android:textColor="#color/black" />
</LinearLayout>
<TextView
android:id="#+id/txtRewardBalance"
style="#android:style/TextAppearance.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:gravity="center"
android:padding="5dip"
android:singleLine="true"
android:textColor="#color/black" />
<ListView
android:id="#+id/offerList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="30dip"
android:fadingEdge="vertical"
android:fadingEdgeLength="20dip"
android:footerDividersEnabled="false"
android:headerDividersEnabled="false"
android:scrollbarStyle="outsideOverlay" >
</ListView>
</LinearLayout>
<LinearLayout
android:id="#+id/linGiftCards"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/txtGiftCardBalance"
style="#android:style/TextAppearance.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:gravity="center"
android:padding="5dip"
android:singleLine="true"
android:textColor="#color/black" />
<TextView
android:id="#+id/txtAddToCard"
style="#android:style/TextAppearance.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:background="#drawable/btn_blue_full_size"
android:gravity="center"
android:padding="5dip"
android:text="#string/add_to_card"
android:textColor="#color/white" />
<TextView
android:id="#+id/txtGiveAGiftCard"
style="#android:style/TextAppearance.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dip"
android:layout_marginTop="10dip"
android:background="#drawable/btn_blue_full_size"
android:drawableLeft="#drawable/ic_gift_card"
android:drawablePadding="6dip"
android:gravity="center"
android:paddingLeft="30dip"
android:paddingRight="30dip"
android:text="#string/give_a_gift_card"
android:textColor="#color/white" />
</LinearLayout>
<TextView
android:id="#+id/txtNoOffersAvail"
style="#android:style/TextAppearance.Medium"
android:layout_width="fill_parent"
android:layout_height="150dip"
android:gravity="center"
android:textColor="#color/black" />
</TableLayout>
</ScrollView>
I am trying to put all under ScrollView except footbar buttons which i believe should be firm at the bottom of screen and align the layouts, but somewhere something is going wrong. Any suggestions. Below is the screenshot and code :
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#E7EBEE"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="#+id/windowtitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#0a2436"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="10dip"
android:paddingTop="10dip"
android:src="#drawable/logo" >
</ImageView>
<ListView
android:id="#+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:divider="#android:color/darker_gray"
android:dividerHeight="1dip"
android:drawSelectorOnTop="false"
android:focusable="false"
android:paddingTop="0dip"
android:scrollbars="none" />
<!-- android:divider="#color/listDivider" -->
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e7ebee"
android:orientation="horizontal" >
<TextView
android:id="#+id/list"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center_vertical"
android:paddingBottom="7dip"
android:paddingLeft="10dip"
android:paddingTop="20dip"
android:text="SNS Connection"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#737577"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="5dip" >
<ImageView
android:id="#+id/facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="10dip"
android:src="#drawable/facebook" />
<TextView
android:id="#+id/list"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center_vertical"
android:paddingLeft="10dip"
android:text="Facebook"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#444444"
android:textSize="20sp" />
<ImageView
android:id="#+id/facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:paddingRight="15dip"
android:src="#drawable/ok" />
</LinearLayout>
<TextView
android:id="#+id/tokentextfacebook"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/facebook"
android:background="#ffffff"
android:gravity="left"
android:paddingBottom="5dip"
android:paddingLeft="10dip"
android:text="Your token is run out. Please reconnect"
android:textColor="#444444"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="5dip" >
<ImageView
android:id="#+id/twitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="10dip"
android:src="#drawable/twitter" />
<TextView
android:id="#+id/list"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center_vertical"
android:paddingLeft="10dip"
android:text="Twitter"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#4a82ae"
android:textSize="20sp" />
<ImageView
android:id="#+id/twitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:paddingRight="15dip"
android:src="#drawable/ok" />
</LinearLayout>
<TextView
android:id="#+id/tokentexttwitter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/facebook"
android:background="#ffffff"
android:gravity="left"
android:paddingBottom="5dip"
android:paddingLeft="10dip"
android:text="Your token is run out. Please reconnect"
android:textColor="#444444"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:gravity="bottom"
android:stretchColumns="*" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<Button
android:id="#+id/btnManualLookup"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:padding="15dip"
android:text="Activity"
android:textColor="#ffffff" />
<Button
android:id="#+id/supportbutton"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:padding="15dip"
android:text="Support"
android:textColor="#ffffff" />
<Button
android:id="#+id/messagebutton"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:padding="15dip"
android:text="Messages"
android:textColor="#ffffff" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_weight="1"
android:text="MARKETING SUPERVISOR"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="CHALLAN"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_weight="1"
android:text="Perm.IncmTax Num."
android:gravity="center"/>
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Code Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center"/>
<EditText
android:id="#+id/editText2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center">
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Name"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Customer Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText4"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Name of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Address of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Sales Order"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Customer Order Date"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INVOICE DETAILS"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Invoice Number"
android:gravity="center"/>
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Date of issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Time of Issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Date of Dispatch of Goods"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Time of Dispatch of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Description of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:layout_weight="1"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Quantity Total"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Unit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Total Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
I am getting the "Force Close" on the execution of xml code.
The error log is giving errors like:
1)TextView cannot be cast to android.view.ViewGroup
2)Unable to update index for central
and some many more weird ones
You have to give different id's to your texViews try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_weight="1"
android:text="MARKETING SUPERVISOR"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="CHALLAN"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_weight="1"
android:text="Perm.IncmTax Num."
android:gravity="center"/>
<EditText
android:id="#+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Code Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center"/>
<EditText
android:id="#+id/editText2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center">
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Name"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView6"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Customer Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText4"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Name of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Address of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView9"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Sales Order"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Customer Order Date"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView11"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INVOICE DETAILS"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/textView12"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Invoice Number"
android:gravity="center"/>
<EditText
android:id="#+id/editText13"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView14"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Date of issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText15"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView16"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Time of Issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText17"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView18"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Date of Dispatch of Goods"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText19"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView20"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Time of Dispatch of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText21"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView22"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Description of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText23"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView24"
android:layout_weight="1"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Quantity Total"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText25"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView26"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Unit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText27"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView28"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Total Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText29"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Hope that helps.
I don't understand why I'm unable to get the linear layout (blue outline) to extend to the full size of the scrollview (the red, green and black areas) in the pic below. I've tried different combinations of gravity and fill but no luck. What am I missing?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/top_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#111111"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="60dip"
android:orientation="horizontal" >
<TextView
android:id="#+id/header"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="50"
android:background="#999999"
android:gravity="center"
android:text="Title"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/bottom_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/pagebar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFF00"
android:gravity="bottom|center"
android:minHeight="70dip"
android:orientation="horizontal" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p1"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page1"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p2"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page2"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p3"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page3"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p4"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page4"
android:textSize="10sp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/bottom_control_bar"
android:layout_below="#id/top_control_bar"
android:measureAllChildren="false" >
<LinearLayout
android:id="#+id/linlay1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#770000"
android:clipChildren="true"
android:duplicateParentState="false"
android:fitsSystemWindows="false"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/searchbar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="60dip"
android:orientation="horizontal" >
<EditText
android:id="#+id/query"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_weight="20"
android:imeOptions="actionSearch"
android:lines="1" >
<requestFocus />
</EditText>
<Button
android:id="#+id/btn_cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="Search"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/buttons"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="60dip"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b1"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b2"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b3"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b4"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/picbar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#android:drawable/toast_frame" />
</LinearLayout>
<LinearLayout
android:id="#+id/actionbar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="10"
android:background="#007700"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_warp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:text="warp"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
I think you want like this
here is the corrected code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="#+id/top_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#111111"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="60dip"
android:orientation="horizontal" >
<TextView
android:id="#+id/header"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="50"
android:background="#999999"
android:gravity="center"
android:text="Title"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/bottom_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/pagebar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFF00"
android:gravity="bottom|center"
android:minHeight="70dip"
android:orientation="horizontal" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p1"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page1"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p2"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page2"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p3"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page3"
android:textSize="10sp" />
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dip" >
<ImageButton
android:id="#+id/b_p4"
android:layout_width="58dip"
android:layout_height="58dip"
android:layout_gravity="top"
android:layout_marginTop="5dip"
android:adjustViewBounds="true"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_p4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:clickable="false"
android:focusable="false"
android:text="page4"
android:textSize="10sp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/bottom_control_bar"
android:layout_below="#id/top_control_bar"
android:fillViewport="true"
android:measureAllChildren="false" >
<LinearLayout
android:id="#+id/linlay1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#770000"
android:clipChildren="true"
android:duplicateParentState="false"
android:fitsSystemWindows="false"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/searchbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="60dip"
android:orientation="horizontal" >
<EditText
android:id="#+id/query"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_weight="20"
android:imeOptions="actionSearch"
android:lines="1" >
<requestFocus />
</EditText>
<Button
android:id="#+id/btn_cancel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="Search"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="60dip"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b1"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b2"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b3"
android:textSize="12sp"
android:textStyle="bold" />
<Button
android:id="#+id/btn_4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="60"
android:drawablePadding="5dip"
android:gravity="center"
android:hapticFeedbackEnabled="true"
android:maxHeight="48dip"
android:minHeight="48dip"
android:text="b4"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/picbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#android:drawable/toast_frame" />
</LinearLayout>
<LinearLayout
android:id="#+id/actionbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:background="#007700"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_warp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:text="warp"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</ScrollView>