大家好,如题:我使用MaterialDialog,想把width改小一点,怎么改?dialog = new MaterialDialog.Builder(this)
                 .customView(R.layout.dialog_waiting_progress, true)
                .show();

解决方案 »

  1.   

    setLayout(float widthPercent, float heightPercent) 
    通过百分比传一个0~1之间的浮点数设置Dialog的宽高,例如:setLayout(0.8f,0.9f)表示宽为屏幕宽的80%,高为屏幕高90%setLayout(int width, int height)
    同样设置Dialog的宽高,却别是传入准确的像素值,单位:px 例如setLayout(500,600)表示宽500个像素,高600个像素
    同样可以调用setWidth和setHeight单独设置宽高,同样支持百分比和像素值不是有这两个方法吗
      

  2.   

    可以了,通过 dialog.getWindow().setLayout(400, 200);
      

  3.   

    哦,customView(View view, true),还有View这个参数。