zoukankan      html  css  js  c++  java
  • [翻译] HSDatePickerViewController

    HSDatePickerViewController

    HSDatePickerViewController is an iOS ViewController for date and time picking, based on awesome look&feel of Dropbox Mailbox application with some customization options.

    HSDatePickerViewController 是一个iOS的视图控制器,用来展示日期选择的,有着Mailbox应用的样式,支持自定义.

    Usage

    Use CocoaPods 

    使用CocoaPods安装

    pod 'HSDatePickerViewController', '~> 1.0'
    

    or add sources from HSDatePickerViewControllerDemo/HSDatePickerViewController subfolder to your project.

    或者直接从demo文件夹中将文件导入项目中即可.

    Import main header:

    导入头文件:

    #import "HSDatePickerViewController.h"

    When needed, create HSDatePickerViewController object:

    在需要的地方,创建出视图控制器对象:

    HSDatePickerViewController *hsdpvc = [HSDatePickerViewController new];

    present it as modal view controller:

    然后prsent出控制器:

    [self presentViewController:hsdpvc animated:YES completion:nil];

    To get returning values, you must conform to the protocol HSDatePickerViewControllerDelegate:

    为了获取返回值,你需要实现代理方法:

    @protocol HSDatePickerViewControllerDelegate <NSObject>
    - (void)hsDatePickerPickedDate:(NSDate *)date;
    @optional
    - (void)hsDatePickerWillDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
    - (void)hsDatePickerDidDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
    @end

    Also, before presenting HSDatePickerViewController, you can change default values of some properties (check HSDatePickerViewController.h file for longer description):

    之后,在present出视图控制器之前,你可以修改一些默认的属性值:

    @property (nonatomic, assign, getter=shouldDismissOnCancelTouch) BOOL dismissOnCancelTouch;
    
    @property (nonatomic, assign) HSDatePickerMinutesStep minuteStep;
    
    @property (nonatomic, strong) UIColor *mainColor;
    
    @property (nonatomic, strong) NSDate *date;
    @property (nonatomic, strong) NSDate *minDate;
    @property (nonatomic, strong) NSDate *maxDate;
    
    @property (nonatomic, strong) NSDateFormatter *dateFormatter;
    @property (nonatomic, strong) NSDateFormatter *monthAndYearLabelDateFormater;
    
    @property (nonatomic, strong) NSString *confirmButtonTitle;
    @property (nonatomic, strong) NSString *backButtonTitle;

    Licence (MIT)

    Copyright (c) 2015 Kamil Powałowski @kamilpowalowski

    For whole licence see LICENCE file.

  • 相关阅读:
    vmware 更换网络后不能上网
    IDEA “Cannot resolve symbol” 解决办法
    SpringBoot MyBatis druid数据库连接池
    解决分页插件ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
    纯CSS绘制不同角度的三角形
    原生js实现移动端点击、长按、左滑、右滑、上滑、下滑等事件模拟
    移动端下拉滚动刷新
    使用锚点定位不改变url同时平滑的滑动到锚点位置,不会生硬的直接到锚点位置
    简单的mock数据调试
    小程序textarea文本域字数控制---并显示已输入字数
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/4307667.html
Copyright © 2011-2022 走看看