首页 > 其他 > 详细

点击cell弹出一个日期选择器

时间:2015-05-25 06:02:46      阅读:1486      评论:0      收藏:0      [点我收藏+]
- (void)setUpGroup2
{
    ILGroupItem *group = [[ILGroupItem alloc] init];
    // 结束时间
    ILSettingItem *endTime = [ILSettingItem itemWithImage:nil title:@"结束时间"];
    endTime.subTitle = @"23:59";
    // __unsafe_unretained __weak
    // __weak会把指针自动清空 p = nil ,能防止野指针错误
    // typeof(self) // 获取类型
    __unsafe_unretained typeof(self) scoreVc = self;

    endTime.option = ^(NSIndexPath *indexPath){
        
        
        UITableViewCell *selCell = [scoreVc.tableView cellForRowAtIndexPath:indexPath];
        
        UITextField *textField = [[UITextField alloc] init];
        
        [textField becomeFirstResponder];
        textField.inputView = [[UIDatePicker alloc] init];
        
        // iOS8会自动做键盘处理,前提是把textField加入到对应cell
        [selCell addSubview:textField];
        
    };
    group.items = @[endTime];
    
    [self.groups addObject:group];
}

  

点击cell弹出一个日期选择器

原文:http://www.cnblogs.com/songxing10000/p/4526900.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!