I am working with slidingdrawer for the first time and i dont know why it gets hidden or worst not getting displayed at at. i have no clue please help.
here is my XML code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrllvwNo1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#F1F3F2"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#BDBEC0"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginBottom="15dp"
android:background="#drawable/titlebar"
android:gravity="center_vertical|center_horizontal|center"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<Button
android:id="#+id/cancelButton"
style="#style/ButtonText"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_gravity="right|center_vertical"
android:layout_weight="1"
android:background="#drawable/button"
android:text="#string/cancelButton" >
</Button>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="2"
android:gravity="center_vertical|center_horizontal|center"
android:text="#string/Terms"
android:textColor="#fff"
android:textSize="23sp" />
<Button
android:id="#+id/agreeButton"
style="#style/ButtonText"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_gravity="right|center_vertical"
android:layout_weight="1"
android:background="#drawable/button"
android:text="#string/agreeButton" >
</Button>
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="#+id/SCROLLER_ID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F1F3F2"
android:fillViewport="true"
android:padding="15dp"
android:paddingBottom="20dp"
android:scrollbars="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:text="#string/termsText"
android:textColor="#595B5A"
android:textSize="14sp" />
</ScrollView>
<SlidingDrawer
android:id="#+id/SlidingDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:content="#+id/contentLayout"
android:handle="#+id/slideHandleButton"
android:background="#00000000"
android:padding="10dip"
android:topOffset="-50dp" >
<Button
android:id="#+id/slideHandleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000" >
</Button>
<LinearLayout
android:id="#+id/contentLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/titlebar"
android:gravity="center|top"
android:orientation="vertical"
android:padding="22dip" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:text="#string/emailValidateConfirmationText"
android:textColor="#fff"
android:textSize="14sp" />
<Button
android:id="#+id/okButtonCreateAccount"
style="#style/ButtonText"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:background="#drawable/button"
android:text="#string/ok" >
</Button>
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
this slider is invoked on a button click using :
slider.animateOpen();
in my code. i have also instiallized the slider as
SlidingDrawer slider = (SlidingDrawer) findViewById(R.id.SlidingDrawer);
You've set the background of your slider button to #00000000, which is fully transparent black (not visible). Try using #FF000000 or #F000.
Related
I'm trying to create the following display, where the text scrolls and the other elements are fixed to the bottom of the screen:
However, it is appearing as follows, where the text doesn't scroll and it's pushing the elements off the screen.:
This is the layout I'm using:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/widget32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<ScrollView
android:id="#+id/scroller"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/txtTC"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:paddingLeft="20dp"
android:layout_alignParentLeft="true" />
</ScrollView>
<CheckBox
android:id="#+id/chkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_gravity="center"
android:text="Don't Show Again"
android:layout_below="#+id/scroller" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/chkBox"
android:layout_alignParentBottom="true">
<RelativeLayout
android:id="#+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:layout_weight="1">
<ImageButton
android:id="#+id/imgCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingTop="0dip"
android:src="#drawable/stop"
android:paddingBottom="5dip"
android:paddingRight="5dip"
android:background="#drawable/common_button" />
<TextView
android:id="#+id/txtCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_below="#id/imgCancel"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="OK"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
What do I need to do to make the text scroll and the other elements fixed to the bottom of the screen?
Try replacing this xml code and apply images where you need
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/widget32"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#5555"
android:gravity="center"
android:orientation="vertical"
android:padding="25dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Terms and Conditions"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ScrollView
android:id="#+id/scroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<TextView
android:id="#+id/txtTC"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="20dp"
android:textSize="20sp" />
</ScrollView>
<CheckBox
android:id="#+id/chkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/scroller"
android:layout_gravity="center_vertical"
android:text="Don't Show Again" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/chkBox"
android:layout_alignParentBottom="true">
<RelativeLayout
android:id="#+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:layout_weight="1">
<ImageButton
android:id="#+id/imgCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingTop="0dip"
android:paddingBottom="5dip"
android:paddingRight="5dip" />
<TextView
android:id="#+id/txtCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_below="#id/imgCancel"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="OK"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
You should add the ScrollView Containing the TextView inside a Layout(Linear would do). I hope it helps
i am working on a custom dialog box and i want to place my close button to the top right corner of the dialog so that the close image would be partially in the dialog box and partially outside....
(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSSfhWv1zPYhmCFVsO70qLY-CqGIKplU3TAVL6zdHaxvLZMsqYnwg)
<?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="match_parent"
android:background="#drawable/someborder"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:gravity="top|left"
android:orientation="vertical"
android:layout_weight="0.65">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="0.82" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:paddingBottom="10dp"
android:paddingLeft="8dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.30"
android:gravity="center"
android:shadowColor="#color/color"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:paddingLeft="1.2dp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:gravity="center|center_vertical"
android:shadowColor="#color/color"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:gravity="center_vertical|center"
android:shadowColor="#color/color"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:gravity="center_vertical|center"
android:shadowColor="#color/color"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="#drawable/horizontal_line" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:orientation="vertical"
android:gravity="top|left"
android:layout_weight=".15">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:paddingLeft="12dp"
android:paddingBottom="5dp">
<CheckBox
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="10dp"
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp"
android:paddingTop="1.75dp"
android:src="#drawable/vertical_line" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="top|right"
android:layout_weight=".38">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".60"
android:orientation="horizontal"
android:gravity="top|right">
<ImageView
android:id="#+id/id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
// Close button
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"/>
// Close Button
</LinearLayout>
<LinearLayout
android:id="#+id/linear_layout"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".40"
android:orientation="vertical"
android:paddingBottom="8dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight=".40"
android:layout_gravity="center"
android:orientation="vertical" >
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="0.33"
android:textAlignment="center"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="0.33"
android:textAlignment="center"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="0.33"
android:textAlignment="center"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Like this image and its red close button.
Thanx everybody in advance..
Here is a way to do it. Place your content layout/view in the same FrameLayout as the close button.
<?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"
>
<!-- The following View represent the content. Note the margin -->
<View
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#44aa00"
android:layout_margin="18dp"
/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:src="#android:drawable/ic_menu_close_clear_cancel"
android:background="#ff0000"
/>
</FrameLayout>
Notes:
Content must be listed before the close button. Button drawn on top of content.
The button is placed in the top right corner by setting the 3 layout parameters:
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
Set a margin on the content to get the "partially outside" effect.
I have one solution for that,
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/img_popup_one"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign In"
android:textColor="#color/clr_gray"
android:textSize="16dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#drawable/img_edittext_bg"
android:hint="Username"
android:padding="5dp"
android:singleLine="true"
android:textColorHint="#color/clr_gray" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#drawable/img_edittext_bg"
android:hint="Password"
android:inputType="textPassword"
android:padding="5dp"
android:singleLine="true"
android:textColorHint="#color/clr_gray" />
</LinearLayout>
</FrameLayout>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="right|top"
android:contentDescription="#string/contentDescription"
android:src="#drawable/img_popup_close" />
</FrameLayout>
</FrameLayout>
I need to have buttons appear below a listview. Any help will be greatly appreciated. I've tried different ways to get this specific layout to appear correctly on android, but so far I haven't been able to figure this out. I want to be able to display a listview in the middle of the app and have buttons under the listview. The problem is that I have other things that need to be displayed on the screen on top of the listview such as tabs and spinners. All of the items in the listview will have both an image and some text to the right of the image. The image that I'd like to achieve is like this image...
android layout image
Here's my code so far...
<?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="match_parent"
android:maxLines="100"
android:orientation="vertical"
android:scrollbars="vertical" >
<Button
android:id="#+id/readWebpage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:onClick="onClick"
android:text="Load Webpage" >
</Button>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="100"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:orientation="horizontal">
<Spinner
android:id="#+id/genre"
android:entries="#array/genre_list"
android:layout_weight="0.40"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
<Spinner
android:id="#+id/sort"
android:entries="#array/sort_list"
android:layout_weight="0.40"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
<Spinner
android:id="#+id/page"
android:entries="#array/page_list"
android:layout_weight="0.20"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/listView" />
<Button
android:id="#+id/previousPage"
android:layout_weight="0.50"
android:layout_width="0dp"
android:layout_height="40dp"
android:onClick="onClick"
android:layout_alignParentBottom="true"
android:text="Previous Page" >
</Button>
<Button
android:id="#+id/nextPage"
android:layout_weight="0.50"
android:layout_width="0dp"
android:layout_height="40dp"
android:onClick="onClick"
android:layout_alignParentBottom="true"
android:text="Next Page" >
</Button>
</LinearLayout>
</LinearLayout>
Use RelativeLayout to control the position of ListView.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="#+id/readWebpage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:onClick="onClick"
android:text="Load Webpage" >
</Button>
<LinearLayout
android:id="#+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/readWebpage"
android:layout_marginTop="1dp"
android:orientation="horizontal" >
<Spinner
android:id="#+id/genre"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:entries="#array/genre_list" />
<Spinner
android:id="#+id/sort"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:entries="#array/sort_list" />
<Spinner
android:id="#+id/page"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:entries="#array/page_list" />
</LinearLayout>
<ListView
android:id="#+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:layout_below="#+id/spinner" />
<LinearLayout
android:id="#+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:id="#+id/previousPage"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="0.50"
android:onClick="onClick"
android:text="Previous Page" >
</Button>
<Button
android:id="#+id/nextPage"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="0.50"
android:onClick="onClick"
android:text="Next Page" >
</Button>
</LinearLayout>
</RelativeLayout>
Set the layout_weight of the buttons to 0 and then set the layout_weight of the listview to 1. The layout_weight is use to allocate extra space, so the buttons will keep their 40dip height and the listview will expand to take up the remaining space
Use the following code;
<?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="match_parent"
android:maxLines="100"
android:orientation="vertical"
android:scrollbars="vertical" >
<Button
android:id="#+id/readWebpage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:onClick="onClick"
android:text="Load Webpage" >
</Button>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:gravity="center"
android:maxLines="100"
android:orientation="horizontal" >
<Spinner
android:id="#+id/genre"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:layout_weight="0.40"
android:entries="#array/genre_list" />
<Spinner
android:id="#+id/sort"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:layout_weight="0.40"
android:entries="#array/sort_list" />
<Spinner
android:id="#+id/page"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:layout_weight="0.20"
android:entries="#array/page_list" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="#+id/listView"
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >
<Button
android:id="#+id/previousPage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:onClick="onClick"
android:text="Previous Page" >
</Button>
<Button
android:id="#+id/nextPage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_weight="1"
android:onClick="onClick"
android:text="Next Page" >
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
No luck after a few days of researching this one. Should be simple, but I'm just not seeing it.
There is an activity page, which has a SliderDrawer. SlidingDrawer icon sits at the bottom, on click or swipe slides open drawer correctly with list of buttons. That all works fine. The problem I'm having is that to accomodate different screensizes and orientations, and the likely addition of additional buttons, I need the contents of that SlidingDrawer to be scrollable. Layout is below. I have tried wrapping the LinearLayout that holds the buttons in a ScrollView without success.
Suggestions?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="#+id/frontpagetitlewrapper"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:id="#+id/top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="blah"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="20sp"
android:gravity="center"
android:layout_alignParentTop="true"
/>
<TextView
android:id="#+id/mid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="and"
android:textColor="#000000"
android:layout_below="#+id/top"
android:textSize="16sp"
android:textStyle="bold"
android:gravity="center"
/>
<TextView
android:id="#+id/bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="blather"
android:textColor="#000000"
android:layout_below="#+id/mid"
android:textSize="18sp"
android:textStyle="bold"
android:gravity="center"
/>
</LinearLayout>
<FrameLayout
android:layout_width="fill_parent"
android:id="#+id/frameLayout"
android:layout_alignParentBottom="true">
<SlidingDrawer android:layout_height="wrap_content"
android:handle="#+id/handle"
android:content="#+id/content"
android:id="#+id/slide"
android:orientation="vertical"
android:layout_width="fill_parent"
>
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#id/handle"
android:src="#drawable/opendrawer">
</ImageView>
<ScrollView
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#id/content"
android:orientation="vertical">
<Button android:text="a" android:id="#+id/btnA" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
<Button android:text="b" android:id="#+id/btnB" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
<Button android:text="c" android:id="#+id/btnC" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
<Button android:text="d" android:id="#+id/btnD" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
<Button android:text="e" android:id="#+id/btnE" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
<Button android:text="f" android:id="#+id/btnF" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="20dip"></Button>
</LinearLayout>
</ScrollView>
</SlidingDrawer>
</FrameLayout>
</RelativeLayout>
I think your problem is that you've tagged the nested LinearLayout with instruction
android:id="#id/content"
so that's the component the SlidingDrawer is using for the content.
Try tagging the ScrollView instead.
<?xml version="1.0" encoding="utf-8"?>
<SlidingDrawer android:layout_width="wrap_content"
android:id="#+id/SlidingDrawer" android:handle="#+id/slideHandleButton"
android:content="#+id/contentLayout" android:padding="10dip"
android:layout_height="250dip">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="#+id/slideHandleButton"
android:background="#drawable/closearrow"></Button>
<LinearLayout android:layout_width="wrap_content"
android:id="#+id/contentLayout" android:orientation="vertical"
android:gravity="center|top" android:padding="10dip"
android:background="#C0C0C0" android:layout_height="wrap_content">
<Button android:id="#+id/Button01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Content"></Button>
<Button android:id="#+id/Button02" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Content"></Button>
<Button android:id="#+id/Button03" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Content"></Button>
</LinearLayout>
</SlidingDrawer>
I've got an input popup that I'm displaying over my activities main view that has some edit boxes in it. When the popup is displayed the activities view stays dimmed in the background (like with an alert dialog).
The issue I'm having is that when the keyboard comes up the popup is ok, but activities view in the background is shifting up. That view should be paused and I wouldn't have thought it would be affected by the keyboard at all. Is there any way to stop this from happening?
I've tried adding android:windowSoftInputMode="adjustPan" to the activity and to the pop-up with no luck.
Here's my activity layout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:background="#drawable/main_bg">
<include android:id="#+id/header" layout="#layout/common_header" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<RelativeLayout
android:id="#+id/contentLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
>
<include android:id="#+id/btnBar" layout="#layout/common_button_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
<LinearLayout
android:id="#+id/webLayout"
android:layout_above="#+id/btnBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/blk"
android:layout_margin="10dp">
<WebView
android:id="#+id/WebView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:background="#drawable/white"
>
</WebView>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
and here is my pop-up layout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/light_grey" android:layout_width="wrap_content" android:minWidth="300dp">
<LinearLayout
android:id="#+id/main_inner_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/white"
android:layout_margin="3dp"
>
<TextView
android:id="#+id/enter_txt"
android:text="Enter Cup Code Below:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="#color/black"
android:layout_gravity="left"
android:typeface="sans"
android:textSize="16dp"
android:layout_margin="10dp"
>
</TextView>
<RelativeLayout
android:id="#+id/code_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#color/white"
>
<EditText
android:text="12345"
android:id="#+id/CodeInputOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_alignParentLeft="true"
></EditText>
<EditText
android:text="12345"
android:id="#+id/CodeInputTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_centerHorizontal="true"
></EditText>
<EditText
android:text="12345"
android:id="#+id/CodeInputThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignParentRight="true"
></EditText>
</RelativeLayout>
<RelativeLayout
android:id="#+id/btn_layout_top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#color/white"
>
<Button
android:id="#+id/AccountBtn"
android:textStyle="bold"
android:text="My Account"
android:layout_marginRight="5dp"
android:layout_alignParentLeft="true"
android:onClick="ClickHandler"
android:layout_height="40dp"
android:layout_width="130dp"
></Button>
<Button
android:id="#+id/SubmitBtn"
android:textStyle="bold"
android:text="Submit"
android:layout_marginLeft="5dp"
android:layout_alignParentRight="true"
android:onClick="ClickHandler"
android:layout_height="40dp"
android:layout_width="130dp"
></Button>
</RelativeLayout>
<RelativeLayout
android:id="#+id/btn_layout_bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#color/white"
>
<Button
android:id="#+id/RewardsBtn"
android:textStyle="bold"
android:text="Rewards"
android:layout_marginRight="5dp"
android:layout_alignParentLeft="true"
android:onClick="ClickHandler"
android:layout_height="40dp"
android:layout_width="130dp"
></Button>
<Button
android:id="#+id/CancelBtn"
android:textStyle="bold"
android:text="Cancel"
android:layout_marginLeft="5dp"
android:layout_alignParentRight="true"
android:onClick="ClickHandler"
android:layout_height="40dp"
android:layout_width="130dp"
></Button>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Thanks!
Try using
android:windowSoftInputMode="adjustPan|adjustResize"
for the activity.