随笔分类 -  Iphone学习

摘要:button=[UIButtonbuttonWithType:UIButtonTypendedRect];//定义一个圆角按钮button.frame=CGRectMake(120, 320, 60, 30);//定义他的位置,大小[buttonsetTitle:@"ok1"forState:UIControlStateNormal];CGAffineTransform transform =CGAffineTransformRotate(3.14/6);//定义一个transform 旋转(3.14/6);[buttonsetTransform:transform];bu 阅读全文
posted @ 2012-09-27 13:17 老码农豆豆 阅读(810) 评论(0) 推荐(0)
摘要:1、字符串转换为日期 NSDateFormatter* dateFormat = [[NSDateFormatter alloc] init];//实例化一个NSDateFormatter对象[dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式NSDate *date =[dateFormat dateFromString:@"1980-01-01 00:00:01"];2、日期转换为字符串 NSDateFormatter* dateFormat = [[NSD 阅读全文
posted @ 2012-09-25 14:55 老码农豆豆 阅读(290) 评论(0) 推荐(0)
摘要:NSString *file = [[NSBundle mainBundle] pathForResource:@”7,0″ ofType:@”png”]; NSString *url = [NSString stringWithFormat:@"<html> <head><script type=\"text/javascript\">document.ontouchmove = function(e){ e.preventDefault();} </script></head><style> 阅读全文
posted @ 2011-08-31 15:42 老码农豆豆 阅读(667) 评论(0) 推荐(0)
摘要:NSString*homeDirectoryPath =NSHomeDirectory(); NSString*imagePath = [homeDirectoryPathstringByAppendingString:@"/graph.png"]; NSLog(@"Image: %@", imagePath); if(![[NSFileManagerdefaultManager]fileExistsAtPath:imagePathisDirectory:NULL]) { UIImageView* myImageView = [[UIImagealloc 阅读全文
posted @ 2011-08-31 15:27 老码农豆豆 阅读(548) 评论(0) 推荐(0)