Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In an Android app, I have this code on my MainActivity class to set width and height of a Button -

Button butn = (Button)findViewById(R.id.butn);
butn.setHeight(30);
butn.setWidth(70);


But this Button size is same for all sizes of emulator.

Is there any way that lets me set the height and width as some percentage of screen height and width ?
Posted
Updated 20-Jan-15 18:24pm
v5

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900