Reputation: 4411
How to change the size of height and width according to the screen size?
Upvotes: 0
Views: 2103
Reputation: 3452
It depends on what you mean by changing the height and width according to the screen size but you should take a look to LayoutParams (layout_height, layout_width, layout_weight, ...) But without any other code, we can't help you
Upvotes: 0
Reputation: 189464
If you only want to change the width and height of a standard view I would recommend trying a completely other approach.
Android apps will run on many different screen sizes. You can't write your code to check for each different size and change the layout. However it is possible to define your layout in a relative way that will adapt to changes in the screen size or orientation.
Main ideas for a relative layout are:
For further information read the Supporting Multiple Screens section in the android documentation.
Upvotes: 1