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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
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.