Android: Rotate Dialog X degrees
How can I rotate a dialog fragment 90 (actually, the number will vary)
degrees in android? My app has the screen locked to portrait orientation,
but when the dialog pops up, I want it rotated some number of degrees.
Here is how I am currently creating the dialog:
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Choose an option")
.setItems(R.array.options_array, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// The 'which' argument contains the index position of the
selected item
switch (which) {
case 0: //copy 1
mListener.onDialogClickCopy(CardDialog.this);
break;
case 1: //copy ...
mListener.onDialogClickCopyX(CardDialog.this);
break;
case 2: //edit text ...
mListener.onDialogClickEdit(CardDialog.this);
break;
case 3: //edit p/t ...
mListener.onDialogClickEditPT(CardDialog.this);
break;
default:
break;
}
}
});
return builder.create();
}
I have tried using .setView with a layout rotated 90 degrees, but that
doesn't help. I want to avoid using a custom view for the dialog so I can
easily use .setItems.
No comments:
Post a Comment