Setting the size of a DialogFragment
问题 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 dialog: getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); getDialog().getWindow().setBackgroundDrawable( new ColorDrawable(android.graphics.Color.TRANSPARENT)); However I also want to position the dialog where I want and it is problematic. I use: WindowManager.LayoutParams params = getDialog().getWindow().getAttributes();