美文网首页iOS开发交流专辑程序员
时间选择器和地点选择器

时间选择器和地点选择器

作者: 伪文艺的程序员 | 来源:发表于2017-03-10 17:56 被阅读106次

废话不多说,开整

Picker

时间选择器

- (IBAction)timeBtnClick:(id)sender {
    
    WLDatePickerView * datePicker = [[WLDatePickerView alloc]initWithFrame:self.view.bounds];
    __weak typeof(self)weakself = self;
    [datePicker show:1 after:0 cancelButton:@"取消" doneButton:@"完成"  cancelButtonDidClikedAction:^(NSDate *date) {
        NSDateFormatter * format = [[NSDateFormatter alloc]init];
        [format setDateFormat:@"  yyyy-MM-dd HH:mm"];
        NSString * timeStr = [format stringFromDate:date];
        weakself.timeLabel.text = timeStr;
    }];

}

地点选择器

- (IBAction)selectAdress:(id)sender {
    [self.view endEditing:YES];
    AddressPickView *addressPickView = [AddressPickView shareInstance];
    [self.view addSubview:addressPickView];
    addressPickView.block = ^(NSString *province,NSString *city,NSString *town){
        
        //UITextField *cityTf = [self.view viewWithTag:702];
        
        _province = province;
        _city = city;
        _town = town;
        _userCity = [NSString stringWithFormat:@"%@,%@,%@",province,city,town];
        
        self.addressLabel.text = _userCity;
        self.addressLabel.textColor = [UIColor blackColor];
    };

}

Clone

git clone https://github.com/KingComeFromChina/Picks.git

Use

已经封装好,Clone下来后,直接把WLDatePickerView和AddressPickView拉入项目中

Picture

时间选择器 时间 地点选择器
地点

相关文章

  • 时间选择器和地点选择器

    废话不多说,开整 Picker 时间选择器 地点选择器 Clone git clone https://githu...

  • css3选择器总结

    选择器分基本选择器和拓展选择器 基本选择器:id选择器,类选择器,元素选择器,通用选择器 拓展选择器:群组选择器,...

  • CSS的基础知识

    选择器使用: 可以分为:基础选择器和高级选择器(复合选择器) 基础选择器:标签选择器、类选择器、id选择器 高级选...

  • css基础知识

    选择器使用: 可以分为:基础选择器和高级选择器(复合选择器) 基础选择器:标签选择器、类选择器、id选择器 高级选...

  • html5选择器

    html5选择器 属性选择器 层级选择器 伪选择器 属性选择器 属性选择器和标签选择器、id选择器、类选择器一样,...

  • 小程序picker组件

    时间选择器 日期选择器 单列选择器 扫码体验

  • jQuery选择器

    jQuery选择器可以分为基本选择器、层次选择器、过滤选择器和表单选择器。 1、基本选择器 2、层次选择器 3、过...

  • css选择器

    目录 1、元素选择器2、选择器分组3、类选择器结合元素选择器使用:多类选择器4、ID选择器ID选择器和类选择器的区...

  • uni-app之picker

    从底部弹起的滚动选择器。支持五种选择器,通过mode来区分,分别是普通选择器,多列选择器,时间选择器,日期选择器,...

  • CSS 3.1 基础

    CSS相关知识和非布局属性 选择器 标签选择器body类选择器.bodyID选择器#body选择器可以叠加 选择器...

网友评论

    本文标题:时间选择器和地点选择器

    本文链接:https://www.haomeiwen.com/subject/nglogttx.html