2015-01-27 3 views
-3

DatePickerDialog에서 캘린더보기를 제거해야합니다.android의 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(); 

이 저를 도와주세요. 감사합니다. 친절하게 생각합니다.

+0

내가 XML에서 DatePicker에서 사용하지 않은이 http://stackoverflow.com/questions/9462448/how-to-turn-off-calendarview-in-a-datepicker –

+0

@ MaheeraJazi-newaccount-를 참조하십시오. 나는 이것을 가지고있다. –

+0

onDateSet()에서 이것을 시도하십시오 view.setCalendarViewShown (false); – justDroid

답변

0

dpd.show();

dpd.getDatePicker().setCalendarViewShown(false);