ios开发怎么让datePicker只显示年和月两项,不显示鈤那一列,求教!!!

解决方案 »

  1.   

    iOS原生的UIDatePicker不支持只显示年和月的选择typedef NS_ENUM(NSInteger, UIDatePickerMode) {
        UIDatePickerModeTime,           // Displays hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. 6 | 53 | PM)
        UIDatePickerModeDate,           // Displays month, day, and year depending on the locale setting (e.g. November | 15 | 2007)
        UIDatePickerModeDateAndTime,    // Displays date, hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. Wed Nov 15 | 6 | 53 | PM)
        UIDatePickerModeCountDownTimer, // Displays hour and minute (e.g. 1 | 53)
    };
    需要自定义来实现。
    参考: Month Picker: http://code4app.com/ios/Month-Picker/51c7e7046803fa7e22000003
    UIDatePicker select Month and Year: http://stackoverflow.com/questions/3348247/uidatepicker-select-month-and-year