本文将带你了解Android应用开发Android Dialog全屏显示,希望本文对大家学Android有所帮助。

"

获取屏幕宽高,设置到Dialog

Dialog dialog = new Dialog(this, R.style.Dialog);

dialog.show();

LayoutInflater inflater = LayoutInflater.from(this);

View viewDialog = inflater.inflate(R.layout.adapter_list, null);

Display display = this.getWindowManager().getDefaultDisplay();

int width = display.getWidth();

int height = display.getHeight();

ViewGroup.LayoutParams layoutParams = new? ViewGroup.LayoutParams(width,

height);

dialog.setContentView(viewDialog, layoutParams);

"

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之Android频道!

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐