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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:33:59+00:00 2026-06-04T00:33:59+00:00

I am trying to do a small code having a condition that if the

  • 0

I am trying to do a small code having a condition that if the Boolean value set true only all the three relatives should appear in the User Interface. If it is set false, only two layouts should be display. I am able to do this.

My problem is when I am checking the condition and set the View.INVISIBLE condition to the layout2, the gap is appearing between the layouts 1 and 3.
How can I remove this gap? My layouts are created in XML like this:

<RelativeLayout
    android:id="@+id/rl_one"
    android:layout_width="wrap_content"
    android:layout_height="40dp"                    
    android:layout_marginLeft="20dp"
    android:layout_marginTop="10dp" />

<RelativeLayout
   android:id="@+id/rl_two"
   android:layout_width="wrap_content"
   android:layout_height="40dp"
   android:layout_below="@+id/rl_one"
   android:layout_marginLeft="20dp"
   android:layout_marginTop="10dp" />

<RelativeLayout
    android:id="@+id/rl_three"
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:layout_below="@+id/rl_two"
    android:layout_marginLeft="20dp"
    android:layout_marginTop="10dp" />

Thank you.

  • 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-04T00:34:00+00:00Added an answer on June 4, 2026 at 12:34 am

    you should have to use View.GONE in place of View.INVISIBLE .

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

Sidebar

Related Questions

Im having a small problem with my code. I have been trying to read
having a small problem. I'm trying to create a loop that will create an
I'm having a small problem trying to malloc this struct. Here is the code
I have a small bit of code that I'm trying to execute with the
I am having a small problem in my code. I am trying to reverse
I'm having a small bit of trouble trying to get this piece of code
Hi I m trying to execute small code in python , it is giving
Begginer's question. I'm trying to write small piece of code in Visual Studio (VB.net)
I'm trying to reuse a small chunk of code inside a custom button class.
Boost Network I am trying out this code in a small console app on

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.