我的代码中有一个进度Dailog。我想在垂直最后一个组件(按钮)之前设置它的位置。请告诉我该怎么做?
代码
progDailog = new ProgressDialog(activity);
//progDailog.setMessage("Loading...");
progDailog.setIndeterminate(false);
progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progDailog.setCancelable(false);
progDailog = new ProgressDialog(activity,R.style.MyTheme);
progDailog.setProgressStyle(android.R.style.Widget_ProgressBar_Small);
progDailog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
progDailog.show();
答案 0 :(得分:0)
这完美地运作了。
progDailog.getWindow().setGravity(Gravity.BOTTOM);