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

  • Home
  • SEARCH
  • 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 9241103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:18:34+00:00 2026-06-18T08:18:34+00:00

in my application layout, i have a setting button….when we push it, it will

  • 0

in my application layout, i have a setting button….when we push it, it will show some sub menus….when we push it again, it will hide all sub menus….look like expandable listview, but not exactly like that….just hiding/unhiding menu in order to get some space for another views….how can i do that?

here is the screenshots that exactly what i want to do

hide menu

unhide menu

here is my xml file:

<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent">
    <EditText
        android:id="@+id/Editsearch"
        android:hint="Enter keyword..."
        android:layout_alignParentLeft="true"
        android:singleLine="true"
        android:layout_width="fill_parent"
        android:layout_toLeftOf="@+id/search"
        android:layout_height="wrap_content" />
    <ImageButton
        android:id="@+id/search"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/button_search"
        android:layout_alignParentRight="true" />
    <Spinner
        android:id="@+id/province"
        android:layout_width="135dp"
        android:layout_height="45dp"
        android:layout_below="@+id/Editsearch"
        android:layout_toLeftOf="@+id/setting"
        android:textSize="12dip"
        android:textStyle="bold"
        android:background="@android:drawable/btn_default"
    />
    <ImageButton
        android:id="@+id/setting"
        android:layout_width="wrap_content"
        android:layout_height="45dip"
        android:layout_below="@+id/Editsearch"
        android:src="@drawable/button_setting"
        android:layout_alignParentRight="true" />
    <Spinner
        android:id="@+id/Category"
        android:layout_width="135dp"
        android:layout_height="45dp"
        android:text="Category"
        android:layout_below="@+id/Editsearch"
        android:layout_alignParentLeft="true"
        android:background="@android:drawable/btn_default" />
        <!-- Job Category title-->
    <TextView
        android:id="@+id/Title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#000000"
        android:typeface="serif"
        android:textSize="13dip"
        android:layout_below="@+id/province"
        android:layout_gravity="center"

        android:text="Total Job : 1982"
        android:textStyle="bold" />
    <ListView
        android:id="@+id/list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/Title"
        android:listSelector="@drawable/list_selector" />
</RelativeLayout>

thank in advance

  • 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-18T08:18:35+00:00Added an answer on June 18, 2026 at 8:18 am

    It is very simple.
    Just place those 3 buttons in a layout and set the visibility of that layout to gone/visible on click of hide/unhide button.

    EDIT :

    It will be like put your spinners which you like to hide/unhide in a layout and provide an ID for it.

    <ImageButton
            android:id="@+id/setting"
            android:layout_width="wrap_content"
            android:layout_height="45dip"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/Editsearch"
            android:src="@drawable/button_setting" />
    
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        **android:id="@+id/submenu_layout"**
        android:layout_below="@+id/Editsearch"
        >
        <Spinner
            android:id="@+id/category1"
            android:layout_width="135dp"
            android:layout_height="45dp"
            android:layout_alignParentLeft="true"
            android:background="@android:drawable/btn_default"
            android:text="Category" />
        <Spinner
            android:id="@+id/category2"
            android:layout_width="135dp"
            android:layout_height="45dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/category1"
            android:background="@android:drawable/btn_default"
            android:text="Category" />
        <Spinner
            android:id="@+id/category3"
            android:layout_width="135dp"
            android:layout_height="45dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/category2"
            android:background="@android:drawable/btn_default"
            android:text="Category" />
        </RelativeLayout>
    

    Then use this id to take the reference of this layout in your code.

    RelativeLayout submenuLayout = (RelativeLayout) findViewById(R.id.submenu_layout);
    

    EDIT 2:

    After that OnClick of setting imageButton :

     if(submenuLayout .getVisibility() == View.VISIBLE)
        submenuLayout .setVisibility(View.GONE);
        else
            submenuLayout .setVisibility(View.VISIBLE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented an application for modify the xml layout with some properties. I
I have some text views in an linear layout in my android application. Next
I have a little issue with setting align of a button in my application.
I have an application layout in my rails app to give a default header/footer
I have two libraries and a single application assembly project layout and I'm wondering
I have created the following database layout, and started coding the application. The more
I have very strange issues in my application. I added a layout file with
I'm currently working out the layout of a WPF Application and seem to have
i am creating a new android application.i am using the table layout. I have
I'm reworking my application, setting some animations. Now basically my Activities are composed <LinearLayout>

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.