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>
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>
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>
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 want to keep the adview layout at bottom in linear layout. i tried using gravity and layout_gravity at bottom but its not working,i had attached the code and snapshot too.
please give me any solution
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/linearmainlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/inner_screen_bg"
android:orientation="vertical"
android:weightSum="10" >
<LinearLayout
android:id="#+id/linear1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingTop="5dip"
android:weightSum="100" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/fbShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/fb_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/twitterShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/tw_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/revealButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/reveal_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
android:id="#+id/imageContainer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginRight="10dip"
android:layout_marginTop="3dp"
android:layout_weight="60"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/imageView"
android:layout_width="320dip"
android:layout_height="150dip"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/image5" >
<ImageView
android:id="#+id/correctMark"
android:layout_width="80dip"
android:layout_height="80dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:src="#drawable/cleared_imag"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/ticketCounterContainer"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/ticket1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/movieName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="#id/linear1"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:background="#drawable/input_field"
android:imeOptions="actionDone"
android:inputType="text"
android:padding="10dip" />
<RelativeLayout
android:id="#+id/correctAnswerLayoutContainer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_below="#id/movieName"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:background="#drawable/circular_rectangle_white_background"
android:paddingLeft="10dip"
android:visibility="gone" >
<LinearLayout
android:id="#+id/hintContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/musical_moview_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/release_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/hint3_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dip"
android:layout_weight="1"
android:background="#drawable/next_btn" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="#string/publisher_id"
ads:loadAdOnCreate="true" />
</LinearLayout>
</LinearLayout>
Try this..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/linearmainlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="10" >
<LinearLayout
android:id="#+id/linear1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingTop="5dip"
android:weightSum="100" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/fbShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/twitterShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/revealButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
android:id="#+id/imageContainer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginRight="10dip"
android:layout_marginTop="3dp"
android:layout_weight="60"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/imageView"
android:layout_width="320dip"
android:layout_height="150dip"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<ImageView
android:id="#+id/correctMark"
android:layout_width="80dip"
android:layout_height="80dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:src="#drawable/ic_launcher"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/ticketCounterContainer"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/ticket1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/movieName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="#+id/linear1"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:imeOptions="actionDone"
android:inputType="text"
android:padding="10dip" />
<RelativeLayout
android:id="#+id/correctAnswerLayoutContainer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_below="#+id/movieName"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:paddingLeft="10dip"
android:visibility="gone" >
<LinearLayout
android:id="#+id/hintContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="musical_moview_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="release_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="hint3_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:orientation="vertical" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="#string/publisher_id"
ads:loadAdOnCreate="true" />
</LinearLayout>
</LinearLayout>
Put the button and Adview in a new relative layout below the linear layouts.
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.