I have a layout which i need to make it look alike Image B. But it comes like Image A. Am i messing too much with Linear or Relative Layouts ? Also i have footbar buttons inside Table Layout which works fine in all other screens but for this it doesn't shows up. Below is my code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:padding="8dip" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:layout_marginLeft="0dip"
android:src="#drawable/back" />
<TextView
android:id="#+id/inboxtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal|center_vertical"
android:background="#f2f2f2"
android:textColor="#444444"
android:text="New message"
android:textSize="18sp" >
</TextView>
<ImageView
android:id="#+id/deleteheader"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="#+id/delete"
android:background="#ffffff"
android:paddingBottom="15dip"
android:paddingTop="15dip" />
<ImageButton
android:id="#+id/emailsender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="#drawable/sendicon"
android:text="Sync" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:gravity="center"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#444444"
android:orientation="vertical" >
<TextView
android:id="#+id/dropdown_textview"
android:layout_width="fill_parent"
android:layout_height="43dp"
android:layout_gravity="top"
android:background="#drawable/dropdown_background"
android:gravity="center_vertical|left"
android:hint="Select Subject"
android:paddingLeft="15dp"
android:textColor="#4a82ae"
android:textSize="15sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_gravity="top"
android:layout_marginTop="44dp"
android:orientation="vertical" >
<EditText
android:id="#+id/mailcontent"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/white"
android:gravity="left"
android:hint="Enter Content Here"
android:paddingLeft="15dp"
android:textColorLink="#color/white" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:id="#+id/dropdown_foldout_menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/dropdown_textview"
android:layout_gravity="top"
android:layout_marginTop="42dp"
android:background="#drawable/dropdown_background"
android:orientation="vertical"
android:padding="1dip"
android:visibility="gone" >
<TextView
android:id="#+id/dropdown_alt0"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 1"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 2"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 3"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 4"
android:textSize="17dp" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
<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/home"
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/status"
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/support"
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>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:padding="8dip" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:orientation="horizontal" >
<ImageView
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dip"
android:src="#drawable/back" />
<ImageView
android:id="#+id/deleteheader"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:background="#ffffff"
android:paddingBottom="15dip"
android:paddingTop="15dip" />
<TextView
android:id="#+id/inboxtext"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:background="#f2f2f2"
android:textColor="#444444"
android:text="New message"
android:textSize="18sp" >
</TextView>
<ImageView
android:id="#+id/deleteheader"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:background="#ffffff"
android:paddingBottom="15dip"
android:paddingTop="15dip" />
<ImageButton
android:id="#+id/emailsender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/sendicon"
android:text="Sync" />
</LinearLayout>
<TextView
android:id="#+id/dropdown_textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#drawable/dropdown_background"
android:gravity="center_vertical|left"
android:hint="Select Subject"
android:padding="10dp"
android:textColor="#4a82ae"
android:textSize="15sp" />
<EditText
android:id="#+id/mailcontent"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"
android:background="#ffffff"
android:gravity="left"
android:hint="Enter Content Here"
android:paddingLeft="15dp"
android:textColorLink="#ffffff" >
<requestFocus />
</EditText>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
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/home"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Activity"
android:textColor="#ffffff" />
<Button
android:id="#+id/status"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Support"
android:textColor="#ffffff" />
<Button
android:id="#+id/support"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Messages"
android:textColor="#ffffff" />
</TableRow>
</TableLayout>
Try with code and for Selecting message You can use pop up.
If you want do by your method then try with this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:padding="8dip" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:orientation="horizontal" >
<ImageView
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:src="#drawable/back" />
<ImageView
android:id="#+id/deleteheader"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:background="#ffffff"
android:paddingBottom="15dip"
android:paddingTop="15dip" />
<TextView
android:id="#+id/inboxtext"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:background="#f2f2f2"
android:gravity="center"
android:text="New message"
android:textColor="#444444"
android:textSize="18sp" >
</TextView>
<ImageView
android:id="#+id/deleteheader"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:background="#ffffff"
android:paddingBottom="15dip"
android:paddingTop="15dip" />
<ImageButton
android:id="#+id/emailsender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/sendicon"
android:text="Sync" />
</LinearLayout>
<TextView
android:id="#+id/dropdown_textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#drawable/dropdown_background"
android:gravity="center_vertical|left"
android:hint="Select Subject"
android:padding="10dp"
android:textColor="#4a82ae"
android:textSize="15sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#f2f2f2" >
<EditText
android:id="#+id/mailcontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:gravity="left"
android:hint="Enter Content Here"
android:paddingLeft="15dp"
android:textColorLink="#ffffff" >
<requestFocus />
</EditText>
<LinearLayout
android:id="#+id/dropdown_foldout_menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/dropdown_background"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:visibility="gone" >
<TextView
android:id="#+id/dropdown_alt0"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 1"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 2"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 3"
android:textSize="17dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#cccccc" />
<TextView
android:id="#+id/dropdown_alt3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/dropdown_selector"
android:gravity="center_vertical|left"
android:padding="10dip"
android:text="Subject 4"
android:textSize="17dp" />
</LinearLayout>
</RelativeLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
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/home"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Activity"
android:textColor="#ffffff" />
<Button
android:id="#+id/status"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Support"
android:textColor="#ffffff" />
<Button
android:id="#+id/support"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#092435"
android:gravity="center"
android:text="Messages"
android:textColor="#ffffff" />
</TableRow>
</TableLayout>
If your requirement is different or any thing else then comment.
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 have header and footer code which i want to add with Relative Layout, but somewhere its messing. Please note the footer has to remain fixed at the bottom of screen despite of scroll of main source. Can someone guide on integration ?
After Vipul's suggestion :
Header :
<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>
Footer :
<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>
Main Source :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:padding="8dp">
<LinearLayout
android:id="#+id/Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dip">
<TextView
android:id="#+id/list_item_entry_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:textColor="#666666"
android:fadingEdge="horizontal"
android:singleLine="true"
android:textSize="18sp"
/>
<TextView
android:id="#+id/list_item_entry_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#666666"
android:layout_alignLeft="#id/list_item_entry_title"
android:layout_below="#id/list_item_entry_title"
android:singleLine="true"
android:textSize="13sp"
/>
</LinearLayout>
<ImageView
android:id="#+id/lefticons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="10dip"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/righticons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="10dip"
android:src="#drawable/icon" />
</RelativeLayout>
Put all three in one relativelayout.
Try following layout:
<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" >
<ImageView
android:id="#+id/windowtitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#0a2436"
android:gravity="center_horizontal|center_vertical"
android:paddingBottom="10dip"
android:paddingTop="10dip"
android:src="#drawable/logo" >
</ImageView>
<TableLayout
android:id="#+id/footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="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>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#id/footer"
android:layout_below="#id/windowtitle"
android:background="#ffffff"
android:padding="8dp" >
<LinearLayout
android:id="#+id/Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dip" >
<TextView
android:id="#+id/list_item_entry_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="#666666"
android:textSize="18sp" />
<TextView
android:id="#+id/list_item_entry_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/list_item_entry_title"
android:layout_below="#id/list_item_entry_title"
android:singleLine="true"
android:textColor="#666666"
android:textSize="13sp" />
</LinearLayout>
<ImageView
android:id="#+id/lefticons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="10dip"
android:src="#drawable/icon" />
<ImageView
android:id="#+id/righticons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="10dip"
android:src="#drawable/icon" />
</RelativeLayout>
</RelativeLayout>
Output:
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>
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>