Setting the size of a DialogFragment

前端 未结 4 1627
执笔经年
执笔经年 2020-12-07 19:13

I have been trying many commands to setup the size of my DialogFragment. It only contains a color-picker, so I have removed the background and title of the dial

4条回答
  •  [愿得一人]
    2020-12-07 19:51

    use this code for resize of Dialog Fragment android

    public void onResume() {
            super.onResume();
            Window window = getDialog().getWindow();
            window.setLayout(250, 100);
            window.setGravity(Gravity.RIGHT);
        }
    

提交回复
热议问题