0

How to specify a minimum width for FragmentDialog?

class TestImage extends DialogFragment{ 
    public Dialog onCreateDialog(Bundle savedInstanceState) { 
        AlertDialog.Builder adb = new AlertDialog.Builder(getActivity()); 
        TableLayout table = new TableLayout(getActivity()); 
        TableRow row = new TableRow(getActivity()); 
        row.addView(new ImageButton(getActivity())); 
        row.addView(new ImageButton(getActivity())); 
        table.addView(row); 
        adb.setView(table); 
        return adb.create(); 
    } 
}

answer proposed in this location does not help. How to set DialogFragment's width and height?

Community
  • 1
  • 1

1 Answers1

0

Set android:minWidth="300dp" in XML.

Check http://developer.android.com/guide/components/fragments.html#Adding for where to put it.

ethree
  • 1,582
  • 2
  • 14
  • 21