android - Margin/Padding in percentage in XML -
i new in android development. want set margin & padding in xml,not in dp or px in percentage. there way this?
it not possible, though better taking width , height of screen below in java code, ,
display display = getwindowmanager().getdefaultdisplay(); int width = display.getwidth(); int height = display.getheight(); then calculate margin screen size, , set by
setmargin(int x) //method of view/layout. this way can set margin depending on screen size not fixed screen, , setting in percentage java code.
Comments
Post a Comment