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

Popular posts from this blog

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -