我使用一個DialogFragment
打開DatePickerDialog
不可能讓我DatePickerDialog使用旋轉式的編程
public class DatePickerFragment extends DialogFragment{
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
// Create a new instance of DatePickerDialog and return it
DatePickerDialog DatePickerDialog = new DatePickerDialog(getActivity(), (ProfileCreationActivity)getActivity(), year, month, day);
return DatePickerDialog;
}
我得到一個日曆的樣子,在那裏我寧願一個微調的樣子。
我想:
datePickerDialog.getDatePicker().setCalendarViewShown(false);
和
datePickerDialog.getDatePicker().setLayoutMode(1);
,但它不工作。
請注意,我希望微調器查找一項活動,但我希望將日曆視圖用於其他活動。所以我不能改變整個應用程序風格。我需要一種活動的自定義樣式。
你應該有什麼工作。事情,讓你去嗯... –
[這個答案](http://stackoverflow.com/a/33138181/2869508)只用一條線爲我工作。 –