如何从android中的DatePickerDialog中删除日历视图?

时间:2015-01-27 06:47:15

标签: android datepickerdialog

我需要从DatePickerDialog中删除日历视图。

代码:

// Process to get Current Date
            final Calendar c = Calendar.getInstance();
            mYear = c.get(Calendar.YEAR);
            mMonth = c.get(Calendar.MONTH);
            mDay = c.get(Calendar.DAY_OF_MONTH);

            // Launch Date Picker Dialog
            DatePickerDialog dpd = new DatePickerDialog(getActivity(),
                    new DatePickerDialog.OnDateSetListener() {

                @Override
                public void onDateSet(DatePicker view, int year,
                        int monthOfYear, int dayOfMonth) {
                    // Display Selected date in textbox
                    _tvDate.setText(dayOfMonth + "-"
                            + (monthOfYear + 1) + "-" + year);

                }
            }, mYear, mMonth, mDay);
            dpd.show();

请帮帮我。 谢谢亲切的问候。

1 个答案:

答案 0 :(得分:0)

在dpd.show();

之前尝试此代码
 dpd.getDatePicker().setCalendarViewShown(false);