iphone--小积累
2011-12-01 23:03
141 查看
小积累:
1:如何设置背景透明 lbl.backgroundColor=[UIColor clearColor];
2:如何设置UIViewControl的frame属性 myViewControl.view.frame = CGRectMake(0, 0, 320 , 100);
3:分别获得 CGRect中的4个属性值(view frame) view.frame.origin.x, frame.origin.y, frame.size.width, frame.size.height
4:如何用代码添加事件: [button addTarget:self action:@selector(buttonClicked) forControlEvents:UIControlEventTouchUpInside];
5: 设置UIButton的自定义样式风格: 在属性栏,选择Type=custon
6:OS4使用自定义动画,以及动画完成后自动调用方法
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationTransitionCurlUp animations:^{ [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; // [delegate ContentView_UnLoad]; // self.view.center = CGPointMake(self.view.center.x,
self.view.center.y+480.0); } completion:^(BOOL finished){ if (finished){ [self unLoadMe]; //[delegate ContentView_UnLoad]; } } ];
7:,当页面跳转时,使用系统自带动画:
//当前页 被跳转页
nContentView=[[UserNewsContentView alloc] initWithNibName:@"UserNewsContentView" bundle:nil SetTypeID:typeStr SetTitleID:titleStr]; [self presentModalViewController:nContentView animated:YES];
//跳转页
-(IBAction)btnContent_click:(id)sender{
[self dismissModalViewControllerAnimated:YES];
}
8:时间戳转换为日期:
NSDate* dat = [NSDate dateWithTimeIntervalSince1970:1319939453];
9:日期转换是星期几:NSDateComponents *weekdayComponents = [[NSCalendar currentCalendar] components:NSWeekdayCalendarUnit fromDate:dat]; int weekday = [weekdayComponents weekday]; NSLog(@"%d",weekday); NSLog(@"%@",dat);
10:请问 怎么查看一个view得superview? [view.superview description]
// [((AppDelegate *)[UIApplication sharedApplication].delegate).window.rootViewController dismissModalViewControllerAnimated:YES]; [((AppDelegate *)[UIApplication sharedApplication].delegate).menuViewController dismissModalViewControllerAnimated:YES]; //[self.presentingViewController.presentingViewController
dismissModalViewControllerAnimated:NO];
11:
利用QuartzCore为UIView视图添加border以及圆角
2011年04月20日 星期三 16:26
1:如何设置背景透明 lbl.backgroundColor=[UIColor clearColor];
2:如何设置UIViewControl的frame属性 myViewControl.view.frame = CGRectMake(0, 0, 320 , 100);
3:分别获得 CGRect中的4个属性值(view frame) view.frame.origin.x, frame.origin.y, frame.size.width, frame.size.height
4:如何用代码添加事件: [button addTarget:self action:@selector(buttonClicked) forControlEvents:UIControlEventTouchUpInside];
5: 设置UIButton的自定义样式风格: 在属性栏,选择Type=custon
6:OS4使用自定义动画,以及动画完成后自动调用方法
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationTransitionCurlUp animations:^{ [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; // [delegate ContentView_UnLoad]; // self.view.center = CGPointMake(self.view.center.x,
self.view.center.y+480.0); } completion:^(BOOL finished){ if (finished){ [self unLoadMe]; //[delegate ContentView_UnLoad]; } } ];
7:,当页面跳转时,使用系统自带动画:
//当前页 被跳转页
nContentView=[[UserNewsContentView alloc] initWithNibName:@"UserNewsContentView" bundle:nil SetTypeID:typeStr SetTitleID:titleStr]; [self presentModalViewController:nContentView animated:YES];
//跳转页
-(IBAction)btnContent_click:(id)sender{
[self dismissModalViewControllerAnimated:YES];
}
8:时间戳转换为日期:
NSDate* dat = [NSDate dateWithTimeIntervalSince1970:1319939453];
9:日期转换是星期几:NSDateComponents *weekdayComponents = [[NSCalendar currentCalendar] components:NSWeekdayCalendarUnit fromDate:dat]; int weekday = [weekdayComponents weekday]; NSLog(@"%d",weekday); NSLog(@"%@",dat);
10:请问 怎么查看一个view得superview? [view.superview description]
// [((AppDelegate *)[UIApplication sharedApplication].delegate).window.rootViewController dismissModalViewControllerAnimated:YES]; [((AppDelegate *)[UIApplication sharedApplication].delegate).menuViewController dismissModalViewControllerAnimated:YES]; //[self.presentingViewController.presentingViewController
dismissModalViewControllerAnimated:NO];
11:
利用QuartzCore为UIView视图添加border以及圆角
2011年04月20日 星期三 16:26
首先引入QuartzCore/QuartzCore.h到类中 然后如下使用: UITextView* yourTextView =[[UITextView alloc] initWithFrame:CGRectMake(0,200,200,100)]; [yourTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]]; [yourTextView.layer setBorderColor:[[UIColor grayColor]CGColor]]; [yourTextView.layer setBorderWidth:1.0]; [yourTextView.layer setCornerRadius:8.0f]; [yourTextView.layer setMasksToBounds:YES]; |
相关文章推荐
- iphone 字符串转换积累中
- iphone 字符串转换积累中
- ipad/iphone开发培训第一天感受
- Iphone官网的所有实例代码
- Integrating AdMob with Cocos2D-iPhone Applications
- iphone聊天用几种图形(表情)与文字混排的实现与比较
- (转) iphone开发资源汇总
- 项目问题解决积累
- iPhone屏幕尺寸、分辨率及适配
- 高薪急聘北京的 iPhone开发工程师
- C#iphone UIButton 的使用
- 使用Html5 video在iPad/iPhone上碰到的几个问题
- iphone发彩信
- Struts2文件上传-学习积累
- 个人知识积累
- Octave 命令积累
- 菜鸟学iPhone开发-Hello World
- IPhone strings文件问题
- 在iphone程序打开其它程序(Launching Other Apps within an iPhone Application)
- 程序员的学习和积累