TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2017 |
Maintained by wuhao.
好用的时间选择器,
pod ‘WHTimePicker’
如果没找到, 请先pod setup, 然后再pod ‘WHTimePicker’
在WHTimePicker.h文件中导入了#import "Masonry.h"
如果你的项目中没有Masonry,会自动帮你导入Masonry
a>> 直接在本网页下载使用:#import "WHTimePicker.h"
b>> 或者利用CocoaPods安装到项目中:#import <WHTimePicker.h>
@interface ViewController () <WHPickerDelegate>
- (void)setupTimePicker{
// 快速创建
WHTimePicker *timePicker = [WHTimePicker timePickerWithType:DateArray];
timePicker.delegate = self;
// 显示时间选择器
[timePicker show];
// 顶部确定栏背景颜色,默认天蓝色
picker.topTitleColor = [UIColor lightGrayColor];
// 顶部"确定","类型","取消"按钮的文字颜色,默认白色
picker.topBackColor = [UIColor blackColor];
}
/** 代理方法一 返回选择的字符串*/
- (void)getSelectedString:(NSString *)string {
NSLog(@"你选择了%@",string);
[button setTitle:string forState:UIControlStateNormal];
}
/** 代理方法二 时间选择器消失的时候回调*/
- (void)timePickerDisappare {
NSLog(@"时间选择器消失了~");
}