Swift 简单控件示例:日期选择器(UIDatePicker)

Swift 简单控件示例:日期选择器(UIDatePicker),第1张

概述转载请声明出处:http://blog.csdn.net/jinnchang/article/details/44619007 ------------------------------------------------------------------------------------------ //// ViewController.swift// UIDatePickerS 转载请声明出处:http://www.jb51.cc/article/p-qwzwtpxe-ga.html
------------------------------------------------------------------------------------------

////  VIEwController.swift//  UIDatePickerSample////  Created by jinnchang on 15/4/2.//  copyright (c) 2015年 Jinn Chang. All rights reserved.//import UIKitclass VIEwController: UIVIEwController {        var datePicker: UIDatePicker!    overrIDe func vIEwDIDLoad() {        super.vIEwDIDLoad()        // Do any additional setup after loading the vIEw,typically from a nib.                datePicker = UIDatePicker(frame: CGRectMake(0,self.vIEw.frame.size.height - 400,self.vIEw.frame.size.wIDth,400))        datePicker.datePickerMode = .DateAndTime        datePicker.date = NSDate()        datePicker.addTarget(self,action: "datePickerValueChange:",forControlEvents: .ValueChanged)                self.vIEw.addSubvIEw(datePicker)    }    overrIDe func dIDReceiveMemoryWarning() {        super.dIDReceiveMemoryWarning()        // dispose of any resources that can be recreated.    }    /// 响应 datePicker 事件    func datePickerValueChange(sender: UIDatePicker) {        println("value change: \(sender.date)")    }}
------------------------------------------------------------------------------------------
GitHub 上项目地址:UIDatePickerSample
控件更多相关属性及方法参考:UIDatePicker Class Reference 文章最后更新时间:2015年4月3日11:18:10
总结

以上是内存溢出为你收集整理的Swift 简单控件示例日期选择器(UIDatePicker)全部内容,希望文章能够帮你解决Swift 简单控件示例:日期选择器(UIDatePicker)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1088491.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存