Android 怎么使一个AlertDialog在屏幕的左下角?
Buildera=newAlertDialog.Builder(this);a.setItems(ShouXuanXiang,newOnClickListener(){@...
Builder a = new AlertDialog.Builder(this);
a.setItems(ShouXuanXiang,new OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
}});
a.setNegativeButton("返回",null);
AlertDialog aa = a.create();
aa.show();
Window w = aa.getWindow();
w.setGravity(Gravity.BOTTOM);
WindowManager.LayoutParams ww = w.getAttributes();
ww.width=300;
aa.getWindow().setAttributes(ww);
这样做只能让其在上 或下 怎么让它在左下角?(去除和屏幕的间距) 展开
a.setItems(ShouXuanXiang,new OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
}});
a.setNegativeButton("返回",null);
AlertDialog aa = a.create();
aa.show();
Window w = aa.getWindow();
w.setGravity(Gravity.BOTTOM);
WindowManager.LayoutParams ww = w.getAttributes();
ww.width=300;
aa.getWindow().setAttributes(ww);
这样做只能让其在上 或下 怎么让它在左下角?(去除和屏幕的间距) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询