zoukankan      html  css  js  c++  java
  • UIDatePicker控件

    用处:选择日期或时间  当选择新的日期或时间的时候,值改变事件会被触发

    -(void)viewDidLoad

    {

        CGRect frame = CGRectMake(20,20,320,100);

      self.datePicker = [[UIDatePicker alloc]initWithFrame:frame];

      //设置显示模式

      self.datePicker.datePickerMode = UIDatePickerModeDate;

      [self.view addSubView:self.datePicker];

      CGRect framelbl = CGRectMake(0,300,320,50);

      self.label = [[UILable alloc]initWithFrame:framelbl];

      [self.view addSubView:self.label];

      //添加值改变事件

      [self.datePicker addTarget:self action:@selector(change:) forControlEvents:UIControlEventValueChanged];

    }

  • 相关阅读:
    Luogu 三国游戏
    牛客练习赛60E
    cf1321E
    cf988D
    cf1089F
    cf1055C
    cf997B
    cf1033D
    cf1062D
    cf1081E
  • 原文地址:https://www.cnblogs.com/AngryCooder/p/3897578.html
Copyright © 2011-2022 走看看