Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8752025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:09:17+00:00 2026-06-13T13:09:17+00:00

I have created sliding drawer for my relative layout which includes some buttons. But

  • 0

I have created sliding drawer for my relative layout which includes some buttons. But when I adjust the height of the drawer the drawer button position changes instead of it’s height. Here is my xml file…….

   <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout
    android:visibility="visible"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 

    xmlns:android="http://schemas.android.com/apk/res/android">

 <com.measure.sizemesurment2.MyView
    android:id="@+id/DrawViewId"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    </com.measure.sizemesurment2.MyView >

  <SlidingDrawer
    android:id="@+id/drawer"
    android:layout_width="wrap_content"
    android:layout_height="100dip"
    android:content="@+id/content"
    android:handle="@+id/handle" >

  <Button
     android:id="@id/handle"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/arrow" />

 <RelativeLayout
     android:id="@id/content"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentBottom="true"
     android:orientation="horizontal" >

     <ImageButton
         android:id="@+id/left"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:onClick="ButtonOnClick"
         android:src="@drawable/left" />

     <ImageButton
         android:id="@+id/right"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="40dp"
         android:onClick="ButtonOnClick"
         android:src="@drawable/right" />

     <ImageButton
         android:id="@+id/up"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="80dp"
         android:onClick="ButtonOnClick"
         android:src="@drawable/up" />

     <ImageButton
         android:id="@+id/down"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="120dp"
         android:onClick="ButtonOnClick"
         android:src="@drawable/down" />

     <Button
         android:id="@+id/plus"
         android:layout_width="40dp"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="180dp"
         android:onClick="ButtonOnClick"
         android:text="+"
         android:textSize="20dp" />

     <Button
         android:id="@+id/minus"
         android:layout_width="40dp"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="220dp"
         android:onClick="ButtonOnClick"
         android:text="-"
         android:textSize="20dp" />

     <Button
         android:id="@+id/ok"
         android:layout_width="60dp"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_marginLeft="260dp"
         android:onClick="ButtonOnClick"
         android:text="OK"
         android:textSize="20dp" />
   </RelativeLayout>
</SlidingDrawer>

</FrameLayout>

where MyView is a class used to draw on canvas. When I set SlidingDrawer height to fill parent I am getting button on the bottom side of my layout. But it’s height is parent’s height, I need limited height and all my buttons should position on the bottom of the layout…
Thanks in advance…..

Hi here is my image I am getting, First one is resulted when set siding drwer height “fill_parent” and the second is for 100dip

image1
image2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:09:17+00:00Added an answer on June 13, 2026 at 1:09 pm

    Its happening because all your buttons are residing in RelativeLayout which is the child of SliderDrawable, So you need to take out your button from it,

    Do something like this

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="visible" >
    
        <SlidingDrawer
            android:id="@+id/drawer"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:content="@+id/content"
            android:handle="@+id/handle" >
    
            <Button
                android:id="@+id/handle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:textSize="50dp"
                android:text="^"
                android:textColor="@android:color/black" />
    
            <RelativeLayout
                android:id="@+id/content"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
            </RelativeLayout>
        </SlidingDrawer>
    
      <com.measure.sizemesurment2.MyView
        android:layout_below="@+id/drawer"
        android:layout_above="@+id/linear_bottom"
        android:id="@+id/DrawViewId"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        </com.measure.sizemesurment2.MyView >
    
        <LinearLayout
            android:id="@+id/linear_bottom"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal" >
    
            <ImageButton
                android:id="@+id/left"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick" />
    
            <ImageButton
                android:id="@+id/right"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick" />
    
            <ImageButton
                android:id="@+id/up"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick" />
    
            <ImageButton
                android:id="@+id/down"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick" />
    
            <Button
                android:id="@+id/plus"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick"
                android:text="+" />
    
            <Button
                android:id="@+id/minus"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick"
                android:text="-" />
    
            <Button
                android:id="@+id/ok"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="ButtonOnClick"
                android:text="OK" />
        </LinearLayout>
    
    </RelativeLayout>
    

    Output:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a sliding form with jquery that slides to the next layout
I have created some JQuery that will expand a div 'popup' on hover and
Friends, i have a xml file including a Sliding drawer. I setContentView in the
I have recently Created a sliding module for Joomla, and I have a JavaScript
I have a few links on a page which refers to some content divs
i have created a jquery onhover vertical sliding menubar now i need to implement
I have a component I created that works like a Viewstack but the next
I have a script that I am developing that creates a sliding button type
I have created a sliding panel that should appear in the center of any
I'm trying to figure out some sliding window stats on my users. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.