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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:04:39+00:00 2026-05-22T01:04:39+00:00

With the below layout (a portion of a larger layout), the container layout’s visibility

  • 0

With the below layout (a portion of a larger layout), the container layout’s visibility is set to “gone” until a button is clicked. On the button click, if the container_ll is not visible, it’s set to visible, and a custom view is added to the reminderViews_ll container.

The views are being added, and the container_ll view is visible on button click. What follows is the width and height of various views after the button is clicked.

container_ll         width 420, height 96.  
lineDivider_view     width 420, height 2 (as expected)  
reminder_img         width 36, height 36 (as expected, hdpi phone)  
reminderViews_ll     width 0, height 96 (argh)


<LinearLayout
    android:id="@+id/container_ll"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:visibility="gone"                   
    >

    <View style="@style/lineDivider_view" />

    <ImageView
        android:id="@+id/reminder_img"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_gravity="center_horizontal"  
        />

    <!-- Stick the actual Reminder TVs + Del buttons in here dynamically -->
    <LinearLayout
        android:id="@+id/reminderViews_ll"
        android:orientation="vertical"
        android:gravity="center"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1.0"
        />                  
</LinearLayout>

I’m at a bit of a loss as to where to go from here. I was thinking invalidate layout, to force it to draw again after making the view visible, but that’s never worked for me (seemingly), and if the reminderViews_ll can get a height of 96, then it can’t be an issue with when it’s calculating the dimensions of the LinearLayout.

I hope you have enjoyed reading this question as much as I have writing it. Any pointers, as always, appreciated.

  • 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-05-22T01:04:39+00:00Added an answer on May 22, 2026 at 1:04 am

    The numbers you show look correct to me.

    The container is width 420. The other views that are set to fill_parent or wrap_content take up all of the space (actually more). The Linear layout then goes to carve up the remaining space to any weighted views. Since there is no space to allocate, you get zero.

    container_ll         width 420  
    lineDivider_view      - 420  
    reminder_img          - 36 
          =               -36
    
    so this makes sense
    reminderViews_ll     width 0
    

    There simply is no room to give it.

    Why are you using a horizontal line divider in your horizontal view?

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

Sidebar

Related Questions

The button doesn't show in this layout(code below),image and textview are shown. I tried
I want to set 2 tabs in above layout and 4 tab below layout
I have a listView with custom objects defined by the xml-layout below. I want
Below is the code of a simple html with a table layout. In FF
In the HTML below, the layout works when the actionBar class has a float
I have a border layout whose center panel is defined like the below. {
Linear layout below. This layout is aligned parent bottom in a Relative Layout. Problem
Simple problem: With the XML layout shown below, I have some views wrapped in
I am running the HelloGallery example for Android (using the XML layout file below),
I'm using a Relative layout as the root or parent container and 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.