pray例子----------------------获取时间,碰触背景键盘消失

来源:互联网 发布:支持大数据的技术 编辑:程序博客网 时间:2024/05/21 11:08

[objc] view plaincopy在CODE上查看代码片派生到我的代码片
  1. - (NSString*)getDate  
  2. {  
  3.     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];  
  4.     [formatter setDateStyle:NSDateFormatterMediumStyle];  
  5.     [formatter setTimeStyle:NSDateFormatterShortStyle];  
  6.     [formatter setDateFormat:@"YY/MM/dd HH:mm"];  
  7.       
  8.     NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];  
  9.     [formatter setTimeZone:timeZone];  
  10.     NSDate *datenow = [NSDate date];  
  11.     return [formatter stringFromDate:datenow];  
  12. }  


碰触背景键盘消失

[objc] view plaincopy在CODE上查看代码片派生到我的代码片
  1. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{  
  2.     UITouch *touch = [touches anyObject];  
  3.     UIView *view = (UIView *)[touch view];  
  4.     if (view == _bkImageView || view == _imageView)  
  5.     {  
  6.         [_upTv resignFirstResponder];  
  7.         [_downTv resignFirstResponder];  
  8.     }  
  9. }  
0 0
原创粉丝点击