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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:51:15+00:00 2026-05-23T11:51:15+00:00

What is the purpose of such code: android:layout_height=-2 Or android:layout_width=-1 How should I interpret

  • 0

What is the purpose of such code:

android:layout_height="-2"

Or

android:layout_width="-1"

How should I interpret such values? Are they in connection to layout_weight attribute?

Thanks

  • 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-23T11:51:15+00:00Added an answer on May 23, 2026 at 11:51 am

    EDIT:
    My mistake, I misunderstood the question.

    The negative values seem to represent match_parent, wrap_content, and fill_parent.

    When -1 or -2 is applied, the view fills the screen just as it would for match_parent or fill_parent. When any number -3 or lower is applied, the behavior is the same as wrap_content.

    The values are not related to the layout_weight, just the pre-defined constants for width and height in Android.

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

Sidebar

Related Questions

When I reading some code, for integer, they use bunch of different type such
Quite simply: is there a place such as DeviantArt, but purely for the purpose
The purpose of this code is to pull upgrade.zip from a central server, extract
so I have such code in my VS ffmpeg video encoder project in C++
How could I modify the below code such that I could, for better readability
I am trying to structure my code in such a way to reduce/avoid code
I normally in my projects use such these code: If user.IsInRole(Admin) Then deleteButton.Visible =
What are the purpose of api specific typedefs such as GLsizei GLint GLvoid? I
Our standard code section for using JDBC is... Connection conn = getConnection(...); Statement stmt
Possible Duplicate: casting unused return values to void I read some source code, and

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.