I have some image that have resolution 320x320.
For the layout_width
it set the value fill_parent
but I do not know what should I set for the layout_height
I want to have equal size for height and width.
If I set layout_height=wrap_content
the width is twice bigger then the height...
How can I tall some layout to fill all the space in x but to have y size just as the size of x
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int width = metrics.widthPixels;
now set the height dynamically using width.
this is the width of the device screen, as you are using layout_width = fill parent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With