利用java代码设置宽度:
//设置宽度
WindowManager m = getWindow().getWindowManager();
Display d =m.getDefaultDisplay();
WindowManager.LayoutParams p =getWindow().getAttributes();
Point size = new Point();
d.getSize(size);
p.width = (int)(size.x*0.8);//设置dialog的宽度为当前手机屏幕的宽度*0.8
getWindow().setAttributes(p);
Activity的四种启动模式:
android:launchMode属性:standard
:标准模式,默认singleTop
:Task栈顶复用模式singleTask
:Task栈内复用模式singleInstance
:全局单例模式
點擊查看更多內容
1人點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦