首页 > 移动平台 > 详细

日期时间的选择器ios源码

时间:2014-11-21 09:08:26      阅读:478      评论:0      收藏:0      [点我收藏+]

这个源码案例是一个日期时间的选择器,源码DVDatePickerTableViewCell,DVDatePickerTableViewCell是使用Swift写的cell。可以在tebleView中提供一个日期时间的选择器,并持续显示在Cell上。
效果图:
  • <ignore_js_op>bubuko.com,布布扣 

使用方法:


DVDatePickerTableViewCell想平常使用cell那样使用即可。 
var cells:NSArray = [] 
cells = [[DVDatePickerTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: nil)]] 

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 
        return cells[indexPath.section][indexPath.row] as UITableViewCell 
    } 
     
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 
         
        var cell = self.tableView(tableView, cellForRowAtIndexPath: indexPath) 
        if (cell.isKindOfClass(DVDatePickerTableViewCell)) { 
            var datePickerTableViewCell = cell as DVDatePickerTableViewCell 
            datePickerTableViewCell.selectedInTableView(tableView) 
        } 
         
        self.tableView.deselectRowAtIndexPath(indexPath, animated: true) 
    } 

日期时间的选择器ios源码

原文:http://www.cnblogs.com/baidulianweikjj/p/4112002.html

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