用AlertDialog很郁闷不能控制 窗体的大小 
还有背景的颜色 还有就是 button的 大小和相对窗体的位置
请问 怎么才可以这样布局!~ 

解决方案 »

  1.   

    当然是可以定制的,
    你创建好dialog后,不要马上show()
    拿到dialog变量后把里面的参数调一下就可以,建议大小不要调整,设好后再show()
    参考dialog.java
      

  2.   

    其实btn大小可以在xml里面设置,
    相对位置,?这样作可能不适合不同的屏幕,不推荐
      

  3.   

            LayoutInflater inflater = LayoutInflater.from(this);
    final View textView = inflater.inflate(
    R.layout.text_view, null);
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setView(textView);
    R.layout.text_view里面布局你的对话框。
      

  4.   

    我也正郁闷中……AlertDialog的宽度似乎不能在代码中改变,尤其是横屏时,变得很宽,很不顺眼。
    求解决方法~~~~~相对位置倒是很好办,用下面的方法解决:
    Window mWindow = cDialog.getWindow();
    WindowManager.LayoutParams lp = mWindow.getAttributes();
    通过lp设置属性,然后mWindow.setAttributes(lp);
      

  5.   

    3楼的办法不行的,xml中的宽度设置无效
      

  6.   

    8樓說的對,就是啊!不知道怎麼讓dialog寬變小一些啊???