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 8229453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:47:56+00:00 2026-06-07T16:47:56+00:00

I have a vertical LinearLayout with 3 Buttons vertically aligned one below the other.

  • 0

I have a vertical LinearLayout with 3 Buttons vertically aligned one below the other. In between each button, i have set a LinearLayout whose visibility is GONE initially. When the 1st button is clicked, the LinearLayout beneath it is changed to VISIBLE and the list view which i have defined in that layout comes in view while the remaining 2 Buttons remain attached to the LinearLayout.

The problem is that if the list view within the LinearLayoutt (which i have added using java code) is too big, then the 2 Buttons below the 1st one go out of view. What remains is the layout beneath the 1st button.

I want the 2 Buttons to be bound to the view. Any help will be appreciated. Thanks.

Here is my layout:

      LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="350dp"
        android:layout_height="match_parent"
        android:orientation="vertical" >


        <Button
            android:id="@+id/buttonContact"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Contacts" 
            android:background="@drawable/button_style" 
            android:textColor="#E6E6E6"/>

        <LinearLayout
            android:id="@+id/layoutContact"
            android:layout_width="match_parent" 
            android:layout_height="wrap_content"                
            android:orientation="vertical"
            android:visibility="gone">
        </LinearLayout>

        <Button
            android:id="@+id/buttonLog"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Call Logs" 
            android:background="@drawable/button_style" />

        <LinearLayout
            android:id="@+id/layoutLog"
            android:layout_width="match_parent"                
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:visibility="gone" >

        </LinearLayout>

        <Button
            android:id="@+id/buttonVm"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Voicemail" 
            android:background="@drawable/button_style"/>

        <LinearLayout
            android:id="@+id/layoutVm"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:visibility="gone">
        </LinearLayout>

    </LinearLayout>
  • 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-07T16:47:59+00:00Added an answer on June 7, 2026 at 4:47 pm

    If i understand your problem correct, you want the last buttons to be in the view irrespective of the list height. Then i would suggest you to use weight for the hidden LinearLayout, use android:layout_weight=1 to achieve your requirement.

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

Sidebar

Related Questions

I have a simple vertical LinearLayout in which there is a button on the
i have my controls in a vertical LinearLayout. All my controls are place below
I have to buttons, one for calculate(in the LEFT) and the other(in the RIGHT)
I have a LinearLayout, which only contains one button. I want this button to
I have a vertical StackPanel with two elements: a Button and a ListBox. How
I have a vertical NSSplitView containing on one of its sides a NSScrollView with
I have a Custom ListView that contains a vertical LinearLayout of horizontal LinearLayouts for
How do I design an android application with two buttons next to each other
I have layout included inside another layout , I want this included one aligned
I have a layout consisting of a LinearLayout with a vertical orientation containing several

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.