Android Tutorial For Beginer - Match Parent and Wrap Content




When designing layouts for your applications in Android there are two sizing definitions that allow us to easily create flexible and adaptive UI. When setting the width or height of a view to match parent it will insure that it takes up the full size of its parent view. When declaring the width or the height of a view to wrap content it will set that size to the minimum size necessary in order to fit the content contained within that view on the screen.
For example in a list of items like the ones displayed here, we can declare that each item should have a width that matches parent, that will insure that the rows take up the full width of the list. Then we can declare that the height of each row should wrap the content of the text within. That will insure that each row will only take up as much height as it needs to display its text.
0 Komentar untuk "Android Tutorial For Beginer - Match Parent and Wrap Content"
Back To Top