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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:19:21+00:00 2026-06-18T18:19:21+00:00

I have a Relative Layout with multiple TextView’s inside. This layout has wrap_content on

  • 0

I have a Relative Layout with multiple TextView’s inside. This layout has “wrap_content” on its height. When certain navigation buttons are pressed, I change the visibility of the TextView’s, so the desired content is displayed.

However, when the next displayed content is smaller than the previous one, the layout doesn’t shrink, and it leaves plenty of empty space. The layout keeps the height of the largest displayed content, and it stays that way.

I would like to shrink this Layout so it wraps the displayed content, and there’s no extra space left.

Here’s the layout code:

    <RelativeLayout 
        android:id="@+id/brief_box"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:background="#7A08AB"
        android:layout_below="@+id/description_navigation">

        <ImageView 
            android:id="@+id/dot_separator_1"
            android:layout_height="1dp"
            android:layout_width="fill_parent"
            android:background="@drawable/dot_separator"
            android:layout_alignParentTop="true"
            android:layout_marginTop="2dp"/>

        <TextView 
            android:id="@+id/brief_about_text"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:layout_below="@+id/dot_separator_1"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="14dp"
            android:layout_marginTop="4dp"
            android:textColor="#FFFFFF"
            android:textSize="16sp"
            android:textStyle="bold"
            android:text="Venga a drogarse compipa! Venga a drogarse compipa! Venga a drogarse compipa! Venga a drogarse compipa! Venga a drogarse compipa!"/>

        <TextView 
            android:id="@+id/brief_about_update_time"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/brief_about_text"
            android:layout_alignParentRight="true"
            android:layout_marginRight="6dp"
            android:textSize="12sp"
            android:textColor="#DFCAE8"
            android:text="Hace 3 horas"/>

        <TextView 
            android:id="@+id/brief_menu_update_time"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/brief_menu_text"
            android:layout_alignParentRight="true"
            android:layout_marginRight="6dp"
            android:textSize="12sp"
            android:textColor="#DFCAE8"
            android:text="Última actualización hace 2 días."
            android:visibility="gone"/>         

        <TextView 
            android:id="@+id/brief_menu_title"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/dot_separator_1"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="4dp"
            android:textColor="#FFFFFF"
            android:textSize="18sp"
            android:textStyle="bold"
            android:text="Menú cachero"
            android:visibility="gone"/>         

        <TextView 
            android:id="@+id/brief_menu_price"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/dot_separator_1"
            android:layout_alignParentRight="true"
            android:layout_marginTop="4dp"
            android:layout_marginRight="10dp"
            android:textColor="#FFFFFF"
            android:textSize="18sp"
            android:textStyle="bold"
            android:text="$4.500"
            android:visibility="gone"/>  

        <TextView 
            android:id="@+id/brief_menu_text"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:layout_below="@+id/brief_menu_title"
            android:layout_marginTop="4dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="10dp"
            android:textColor="#FFFFFF"
            android:textSize="12sp"
            android:textStyle="bold"
            android:text="Fantástico menú que contiene ilimitadas posibilidades de contraer una diarrea que durará mas de una semana. Contiene cochayuyo con guatitas y caca, sopa, ensalada, y bebida."
            android:visibility="gone"/>                         

        <TextView 
            android:id="@+id/brief_where_title"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/dot_separator_1"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="6dp"
            android:textColor="#FFFFFF"
            android:textSize="14sp"
            android:text="Encuéntranos en:"
            android:visibility="gone"/>        

        <TextView 
            android:id="@+id/brief_where_text"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/brief_where_title"
            android:layout_marginLeft="20dp"
            android:layout_marginBottom="8dp"
            android:textColor="#FFFFFF"
            android:textSize="18sp"
            android:text="Lota 3495, Providencia"
            android:visibility="gone"/>  

        <ImageView 
            android:id="@+id/brief_where_how_to_arrow"
            android:layout_width="11dp"
            android:layout_height="20dp"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/dot_separator_1"
            android:layout_marginRight="4dp"
            android:layout_marginTop="20dp"
            android:background="@drawable/arrow_tag"
            android:visibility="gone"/>                                 

        <TextView 
            android:id="@+id/brief_where_how_to"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_below="@+id/dot_separator_1"
            android:layout_toLeftOf="@+id/brief_where_how_to_arrow"
            android:layout_marginTop="16dp"
            android:textColor="#FFFFFF"
            android:textSize="11sp"
            android:textStyle="bold"
            android:text="content"
            android:visibility="gone"/>           



    </RelativeLayout>

Here are some screenshots of the issue.

This is the large content:

http://i46.tinypic.com/29xwuw0.png

And this is the small content, with the large content layout:

http://i47.tinypic.com/29gbogm.png

I would appreciate any help.

  • 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-18T18:19:23+00:00Added an answer on June 18, 2026 at 6:19 pm

    Be sure to use View.GONE to make a view disappear (and not View.INVISIBLE).

    And, when looking at your XML layout, it seems a vertical LinearLayout would be better for what you’d like to accomplish.

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

Sidebar

Related Questions

I have this ImageView block inside a Relative layout: <ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentBottom=true android:layout_marginBottom=50dip
I have a background image child inside a relative layout: <ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:scaleType=centerInside
I have imageView inside a relative layout. And when i create the activity i
I have this layout that works correctly, a relative layout with a text view
I have designed the screen using this relative layout. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
Ok I have a relative layout inside a linear one.Until now,the relative layout was
I have a pretty complex layout that has multiple types of views and I
I have a relative layout <RelativeLayout android:layout_width=match_parent android:layout_height=wrap_content > <ImageView android:id=@+id/ivLogo android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true
I want to have a relative layout inside another full-screen relative layout, occupying full
i have a relative layout and i have two buttons in it with texts

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.