Scroll View in android activity - android

I ahve made a simple activity in that i have used scrollView but its not working and shows error,so i have removed scrollView..Friends i need is all the menus should be included to scrollView..Please can anyone suggest me wher7e should i place the "scrollView" tag in my activity.
my activity is as below:
main-menu.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/kevingreen" android:background="#000" android:layout_weight="1"/>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.3"
android:background="#fffff3"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="fill_parent"
android:layout_height="190dp" >
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="#+id/imageButtonVideos"
android:layout_width="fill_parent"
android:layout_height="115dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/balcony_pic" />
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Videos"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout7"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonTraining2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/crowd_pic" />
<TextView
android:id="#+id/TextView02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:gravity="center"
android:text="Training"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonCalculator"
android:layout_width="fill_parent"
android:layout_height="94dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:background="#0000"
android:scaleType="fitCenter"
android:src="#drawable/calculator" />
<TextView
android:id="#+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:gravity="center"
android:text="Property Calculator"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="fill_parent"
android:layout_height="148dp"
android:layout_marginBottom="10dp" >
<LinearLayout
android:id="#+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonShop"
android:layout_width="fill_parent"
android:layout_height="77dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/compra" />
<TextView
android:id="#+id/TextView03"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Shop"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayout02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonAboutKevin"
android:layout_width="fill_parent"
android:layout_height="82dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/about_me_pic" />
<TextView
android:id="#+id/TextView04"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="About Kevin"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayout03"
android:layout_width="84dp"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonLinks"
android:layout_width="fill_parent"
android:layout_height="88dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#0000"
android:scaleType="fitCenter"
android:src="#drawable/coaching_pic" />
<TextView
android:id="#+id/TextView05"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.88"
android:gravity="center"
android:text="Social"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayoutthird"
android:layout_width="match_parent"
android:layout_height="102dp"
android:layout_marginBottom="10dp" >
<LinearLayout
android:id="#+id/LinearLayoutsubthird"
android:layout_width="298dp"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="0.83"
android:orientation="vertical" >
<ImageButton
android:id="#+id/ImageButtonBlog"
android:layout_width="130dp"
android:layout_height="102dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/blogger" />
<TextView
android:id="#+id/TextViewblogger"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Blogger"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutabout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout android:layout_width="fill_parent" android:id="#+id/LinearLayoutabout" android:layout_height="fill_parent" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:layout_weight="1" android:orientation="vertical">
<ImageButton android:id="#+id/ImageButtonContactUs" android:layout_width="130dp" android:layout_height="102dp" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="40dp" android:background="#0000" android:scaleType="centerCrop" android:src="#drawable/contact_us_478x318"/>
<TextView android:id="#+id/TextViewcontactus" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:gravity="center" android:text="Contact Us" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textStyle="bold"/>
</LinearLayout>
<ImageButton
android:id="#+id/ImageButtonContactUs"
android:layout_width="130dp"
android:layout_height="182dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="40dp"
android:background="#0000"
android:scaleType="centerCrop"
android:src="#drawable/contact_us_478x318" />
<TextView
android:id="#+id/TextViewcontactus"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="Contact Us"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1" android:background="#drawable/gradient_grey">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="#+id/imageButtonHome"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/g3570" android:layout_weight="0.6" android:background="#0000" android:scaleType="fitCenter" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Home"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="#+id/imageButtonTraining"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/g4404" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Training"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" android:orientation="vertical">
<ImageButton
android:id="#+id/imageButtonContactUs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="#drawable/icon_email" android:layout_weight="0.6" android:scaleType="fitCenter" android:background="#0000" android:layout_marginTop="5dp"/>
<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Contact Us"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceMediumInverse" android:textColor="#fff" android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Please tell me where should i place scrollView tag so that it will work properly..Thank you in advance.!

Put all your views in a parent layout and then add ScrollView to that parent layout in xml. As ScrollView can be added to only one child. Hope this helps.

Place the <ScrollView> after first <ImageView> tag and place your menu items in a single <LinearLayout> tag as ScrollView works only for a single child.

Related

which layout i have to use for the below screenshot

Actually i have to create a xml layout as similar to the below screenshot and i know there is two cardView in linear Layout of having weight
but can anyone check my code and guide me i on the correct path or not...
xml code:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="#dimen/padding_top_bottom">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="#color/cardViewbackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/icon_btw_margin"
android:layout_marginLeft="#dimen/padding"
android:src="#drawable/service_provide_box_icon"
android:layout_marginTop="#dimen/padding"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_marginRight="#dimen/icon_btw_padding" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginStart="30dp"
android:layout_marginLeft="#dimen/icon_btw_padding"
android:text="#string/testAddress"
android:textColor="#color/buttonbackground"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_marginRight="#dimen/icon_btw_padding"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.7"
android:layout_marginStart="#dimen/padding_top_bottom"
android:layout_marginLeft="#dimen/padding_top_bottom"
>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
app:cardBackgroundColor="#color/cardViewbackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/car_services_icon_one"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
/>
</android.support.v7.widget.CardView><android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
app:cardBackgroundColor="#color/cardViewbackground"
android:layout_marginStart="6dp"
android:layout_marginLeft="#dimen/icon_btw_margin"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/car_services_icon_three"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="0sp">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
>
<android.support.v7.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#color/cardViewbackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/icon_btw_margin"
android:layout_marginLeft="#dimen/padding"
android:src="#drawable/mechanics_available_icon"
android:layout_gravity="top"
android:layout_marginTop="#dimen/padding"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_marginRight="#dimen/icon_btw_padding" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginStart="30dp"
android:layout_marginLeft="#dimen/icon_btw_padding"
android:paddingTop="2dp"
android:text="#string/testMechanics"
android:textColor="#color/colorAccent"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_gravity="center_vertical"
android:layout_marginRight="#dimen/icon_btw_padding"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.7"
android:layout_marginStart="#dimen/padding_top_bottom"
android:layout_marginLeft="#dimen/padding_top_bottom"
>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
app:cardBackgroundColor="#color/cardViewbackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/car_services_iconfour"
android:layout_marginLeft="2dp"
android:paddingTop="1sp"
android:layout_marginRight="2dp"
/>
</android.support.v7.widget.CardView><android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
app:cardBackgroundColor="#color/cardViewbackground"
android:layout_marginStart="6dp"
android:layout_marginLeft="#dimen/icon_btw_margin"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/car_services_icon_two"
android:layout_marginLeft="2dp"
android:paddingTop="1sp"
android:layout_marginRight="2dp"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="0sp">
<android.support.v7.widget.CardView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#color/cardViewbackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/icon_btw_margin"
android:layout_marginLeft="#dimen/padding"
android:src="#drawable/mechanics_available_icon"
android:layout_gravity="top"
android:layout_marginTop="#dimen/padding"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_marginRight="#dimen/icon_btw_padding" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginStart="30dp"
android:layout_marginLeft="#dimen/icon_btw_padding"
android:paddingTop="2dp"
android:text="#string/testMechanics"
android:textColor="#color/colorAccent"
android:layout_marginEnd="#dimen/icon_btw_padding"
android:layout_gravity="center_vertical"
android:layout_marginRight="#dimen/icon_btw_padding"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
Use this XML . may be its helpful for your work..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="5sp"
android:weightSum="4">
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
app:cardElevation="4dp"
app:cardUseCompatPadding="false"
app:cardBackgroundColor="#555555">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10sp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#124688"
android:drawableStart="#drawable/yourimage"
android:text="500 west and avenue suite 5A"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:gravity="center_vertical"
android:drawableStart="#drawable/mechanic image"
android:text="12 Mechanics availabe"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:gravity="center_vertical"
android:drawableStart="#drawable/watchimage"
android:text="9:00AM to 11:00PM"/>
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.5"
android:scaleY="0.5"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
app:cardElevation="4dp"
android:layout_weight="1"
app:cardUseCompatPadding="false"
app:cardBackgroundColor="#555555">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1"
android:weightSum="2">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/image1"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/image2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1"
android:weightSum="2">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/image3"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="#drawable/image4"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

Background at the end

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>

Android xml layout about spinner,textview and imageview

I am trying to create a certain layout,I hope it same as picture.
But textview and imageview layout are ran out boundaries.
How can I fix it ?
I hope textview and imageview can under spinner.
This is my current code,thanks
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal" >
<Spinner
android:id="#+id/spinner_show"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15px"
android:drawSelectorOnTop="true" />
<ImageView
android:id="#+id/icon1"
android:layout_marginTop="130px"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:background="#777"
android:contentDescription="#string/app_name"
android:padding="3dp" />
<LinearLayout
android:layout_width="185dp"
android:layout_height="86dp"
android:layout_marginTop="130px"
android:gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="#+id/itemname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:maxLines="3"
android:text="#string/itemname"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="#+id/detil"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:text="#string/detil"
android:textColor="#android:color/black"
android:textSize="12dp" />
</LinearLayout>
<ImageView
android:id="#+id/arrow"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_marginRight="5dp"
android:contentDescription="#string/app_name"
android:src="#drawable/arrow_next" />
</LinearLayout>
You can try as follows...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Spinner
android:id="#+id/spinner_show"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15px"
android:drawSelectorOnTop="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="100dp"
android:orientation="horizontal" >
<ImageView
android:id="#+id/icon1"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#777"
android:contentDescription="#string/app_name"
android:padding="3dp" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/itemname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:maxLines="3"
android:text="#string/itemname"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="#+id/detil"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:text="#string/detil"
android:textColor="#android:color/black"
android:textSize="12dp" />
</LinearLayout>
<ImageView
android:id="#+id/arrow"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:layout_marginRight="5dp"
android:contentDescription="#string/app_name"
android:src="#drawable/arrow_next" />
</LinearLayout>
</LinearLayout>
try this..........
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Spinner
android:id="#+id/spinner_show"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15px"
android:drawSelectorOnTop="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_marginTop="100px"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<ImageView
android:id="#+id/icon1"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#777"
android:contentDescription="#string/app_name"
android:padding="3dp" />
<LinearLayout
android:layout_width="185dp"
android:layout_height="86dp"
android:gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="#+id/itemname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:maxLines="3"
android:text="itemname"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="#+id/detil"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="1"
android:text="detil"
android:textColor="#android:color/black"
android:textSize="12dp" />
</LinearLayout>
<ImageView
android:id="#+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:contentDescription="#string/app_name"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</LinearLayout>
here is your layout ...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Spinner
android:id="#+id/spinner_show"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15px"
android:drawSelectorOnTop="true" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:weightSum="3" >
<ImageView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight=".5"
android:background="#ababab" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="#+id/itemname"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="hello text"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="#+id/detil"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="hello text"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight=".5"
android:background="#ababab" />
</LinearLayout>
</LinearLayout>

Viewflipper not fit my design (fluid layout)

I have this code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/fondo"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context=".Inicio" >
<ViewFlipper
android:id="#+id/flipper1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_margin="40dp"
android:layout_weight="1"
android:fillViewport="true" >
<ImageView
android:id="#+id/rotacion1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="#string/img_desc"
android:scaleType="fitXY"
android:src="#drawable/rotacion1" />
<ImageView
android:id="#+id/rotacion2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="#string/img_desc"
android:scaleType="fitXY"
android:src="#drawable/rotacion2" />
</ViewFlipper>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="100dp"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal"
android:paddingTop="1dp" >
<TextView
android:id="#+id/textBienve"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_bienvel"
android:gravity="center_horizontal"
android:onClick="menu1"
android:text="#string/menu1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
<TextView
android:id="#+id/textMenudia"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_menu"
android:gravity="center_horizontal"
android:onClick="menu2"
android:text="#string/menu2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
<TextView
android:id="#+id/textEspeciali"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_espec"
android:gravity="center_horizontal"
android:onClick="menu3"
android:text="#string/especialidades"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="100dp"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal"
android:paddingBottom="1dp"
android:paddingTop="1dp" >
<TextView
android:id="#+id/textCeleb"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_celeb"
android:gravity="center_horizontal"
android:onClick="menu4"
android:text="#string/menu4"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
<TextView
android:id="#+id/textProvee"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_prove"
android:gravity="center_horizontal"
android:onClick="menu5"
android:text="#string/menu5"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
<TextView
android:id="#+id/textLocalic"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:background="#30c2c2c2"
android:clickable="true"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_local"
android:gravity="center_horizontal"
android:onClick="menu6"
android:text="#string/menu6"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/ImageView01"
android:layout_width="0dp"
android:layout_height="55dp"
android:layout_weight="1"
android:contentDescription="#string/fondo"
android:src="#drawable/iconossocialesf" />
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="55dp"
android:layout_weight="1"
android:background="#30c2c2c2"
android:gravity="center_vertical|center_horizontal"
android:onClick="mostrardialog"
android:text="#string/contacto"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="0dp"
android:layout_height="55dp"
android:layout_weight="1"
android:contentDescription="#string/fondo"
android:src="#drawable/iconossocialest" />
</LinearLayout>
i need that the viewflipper go fluid, but this is not even shown and not adjust to my screen.if I put a size such 200DP all my layouts go down or up according to the screen size, i only want to adjust all the layouts to max screen size.
what I do wrong?

Android Linear Layout not filling 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>

Categories

Resources