Setting View's Width & Height to -1

DerekTweed

Member
Licensed User
Longtime User
In the code for an example widget that I have downloaded, an Imageview has Width & Height set to -1. What effect does this have?
I have searched for a reference to this, but cannot find one.

Thanks
 

agraham

Expert
Licensed User
Longtime User
ViewGroup.LayoutParams | Android Developers
public static final int MATCH_PARENT

Added in API level 8

Special value for the height or width requested by a View. MATCH_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. Introduced in API Level 8.

Constant Value: -1 (0xffffffff)
 
Upvote 0
Top