Android设置屏幕大小

//设置屏幕占比

WindowManager manager = getWindow().getWindowManager();

Display d = manager.getDefaultDisplay();

WindowManager.LayoutParams params = getWindow().getAttributes();

Point size =new Point();

d.getSize(size);

params.width = (int) (size.x*0.8);

getWindow().setAttributes(params);

你可能感兴趣的:(Android设置屏幕大小)