iOS UI一些设置方法
来源:互联网 发布:手机淘宝网充话费充值 编辑:程序博客网 时间:2024/06/04 17:48
1:如何设置背景透明 lbl.backgroundColor=[UIColorclearColor];
2:如何设置UIViewControl的frame属性 myViewControl.view.frame = CGRectMake(0, 0, 320 ,100);
3:分别获得 CGRect中的4个属性值(viewframe) 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:0options:UIViewAnimationTransitionCurlUp animations:^{ [UIViewsetAnimationTransition:UIViewAnimationTransitionCurlUpforView: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:typeStrSetTitleID:titleStr]; [self presentModalViewController:nContentViewanimated:YES];
//跳转页
-(IBAction)btnContent_click:(id)sender{
[selfdismissModalViewControllerAnimated:YES];
}
8:时间戳转换为日期:
NSDate* dat = [NSDatedateWithTimeIntervalSince1970:1319939453];
9:日期转换是星期几:NSDateComponents *weekdayComponents = [[NSCalendarcurrentCalendar] components:NSWeekdayCalendarUnit fromDate:dat];int weekday = [weekdayComponents weekday]; NSLog(@"%d",weekday);NSLog(@"%@",dat);
10:请问怎么查看一个view得superview? [view.superview description]
// [((AppDelegate *)[UIApplicationsharedApplication].delegate).window.rootViewControllerdismissModalViewControllerAnimated:YES]; [((AppDelegate*)[UIApplication sharedApplication].delegate).menuViewControllerdismissModalViewControllerAnimated:YES];//[self.presentingViewController.presentingViewControllerdismissModalViewControllerAnimated: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:[[UIColorgrayColor]CGColor]];
[yourTextView.layersetBorderWidth:1.0];
[yourTextView.layersetCornerRadius:8.0f];
[yourTextView.layersetMasksToBounds:YES];
12遍历一个View的子视图并且删除
for (UIView *oneView in ViewBody.subviews ){
[oneView removeFromSuperview];
}
2:如何设置UIViewControl的frame属性
3:分别获得
4:如何用代码添加事件:
5:设置UIButton的自定义样式风格: 在属性栏,选择Type=custon
6:OS4使用自定义动画,以及动画完成后自动调用方法
[UIView animateWithDuration:0.5 delay:0options:UIViewAnimationTransitio
7:,当页面跳转时,使用系统自带动画:
//当前页
nContentView=[[UserNewsContentView alloc]initWithNibName:@"UserNewsContentView" bundle:nil SetTypeID:typeStrSetTitleID:titleStr]; [self presentModalViewControll
//跳转页
-(IBAction)btnContent_click:(id)sender{
}
8:时间戳转换为日期:
NSDate* dat = [NSDatedateWithTimeIntervalSinc
9:日期转换是星期几:NSDateComponents *weekdayComponents = [[NSCalendarcurrentCalendar] components:NSWeekdayCalendarUnit fromDate:dat];int weekday = [weekdayComponents weekday]; NSLog(@"%d",weekday);NSLog(@"%@",dat);
10:请问怎么查看一个view得superview?
// [((AppDelegate *)[UIApplicationsharedApplication].delegate).window.rootViewControllerdismissModalViewControll
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]];
12遍历一个View的子视图并且删除
for (UIView *oneView in ViewBody.subviews ){
- iOS UI一些设置方法
- IOS之UI 作业
- IOS Monkey测试UI AutoMonkey
- IOS 5 设置NavigationBar 背景
- iOS 代码设置自动布局
- iOS DES 加密方法
- iOS DES加密的方法
- PHP 时间 时区设置 方法
- IOS UI view button 自定义颜色………
- IOS之UI 视图(笔记)
- IOS之UI 绘图(笔记)
- IOS之UI 手势、事件、…
- IOS UI界面 点击界面空…
- IOS之UI UITextField、UILabe…
- ios BOKE
- IOS 99乘法表
- iOS label
- iOS 多线程的一些总结 …
- objective-c 文件
- 使用dwz一些记录
- IOS Objective c 同步 异步链接 …
- objective-c Objective-C语法之动…
- objective c 单例模式
- iOS UI一些设置方法
- hdu 3065 病毒侵袭持续中(AC自动机)
- objective c 计算
- IOS UI view button 自定义颜色………
- ios字体样式
- IOS控件学习之UILabel
- objective-c 中随机数的用法 (3种…
- IOS 关灯游戏
- IOS 彩虹灯 程序