Guest User

Untitled

a guest
Apr 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. DisplayMetrics metrics = new DisplayMetrics();
  2. WindowManager windowManager = (WindowManager) Actividad1.this.getSystemService(Context.WINDOW_SERVICE);
  3. if (windowManager != null) {
  4. windowManager.getDefaultDisplay().getMetrics(metrics);
  5. }
  6. int ancho = metrics.widthPixels;
  7. int alto = metrics.heightPixels;
  8.  
  9. mi_botón.setLayoutParams(new LinearLayout.LayoutParams(ancho/5, 13*ancho/100));
Add Comment
Please, Sign In to add comment