![](/img/trans.png)
[英]How to open new activity from bottom and hold that activity by half of screen
[英]How can I open the dialog from bottom but it will be show only in between half of the screen from bottom in android
这是我尝试从底部进行对话框的方法
dialog = new Dialog(activity, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.coachingtip_discover);
ImageView imageclose = (ImageView) dialog.findViewById(R.id.btn_close1);
TextView textsmg = (TextView) dialog.findViewById(R.id.discover_inspire_text);
TextView textsmg2 = (TextView) dialog.findViewById(R.id.add_photo_text2);
TextView textsmg3 = (TextView) dialog.findViewById(R.id.add_photo_text1);
dialog.show();
这是在底部渲染Dialog
的方式:
dialog = new Dialog(activity, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.coachingtip_discover);
Window window = dialog.getWindow();
WindowManager.LayoutParams wlp = window.getAttributes();
wlp.gravity = Gravity.BOTTOM;
wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;
window.setAttributes(wlp);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.