前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >IOS基础知识第二季

IOS基础知识第二季

作者头像
苦咖啡
发布2018-05-08 16:54:32
9470
发布2018-05-08 16:54:32
举报
文章被收录于专栏:我的博客我的博客

1.分辨率:320*480,640*960 2.icon图标需要两个(57*57) 114*114 用于视网膜屏幕 icon@2x.png,icon.png 3.狂写代码,先写再调试、搜索、自学 4.iphone5设备是4英寸之前是3.5英寸,视网膜技术960*640 iphone4 5.320*480 启动页 640*960 Default@2x.png iphone5 Default-568h@2x.png 6.icon需要有29*29 和 58*58 7.模拟器快捷键: 8.沙盒:IOS将各个APP分别存放再文件系统的独立位置 模拟器中的沙盒位置:~/Library/资源库/Application Support/Iphone Simulator/ 9.应用程序周期;main—UIapplicationmain处理()—-applicationDidFinishLau main创建自动释放池,调用UIApplicationMain,释放自动释放池 10.作业: icon、default、app名字、100秒倒计时、后台挂起

11.UIKIT框架结构 UIView是视图的基类 UIViewController是视图控制器的基类 12.每个应用至少一个窗口,UIWindow继承UIView 自动创建(xcode4.5之后) 13.UIScreen对象可以充当IOS设备物理屏幕的替代者 14.Iphone4之前320*480 IPHone4,4s是640*960 iphone5设备屏幕:640*1136 ipad/ipad2:1024*768 ipad3/ipad4:2048*1536 ipad mini: 1024 *768 15. 时间绑定方法,第一个是事件名称,第二个是触发条件 [startButton addTarget:self action:@selector(alertUser) forControlEvents:UIControlEventTouchUpInside]; 16.Ui创建两种方式 xib创建 NSBundle *bundle = [NSBundle mainBundle]; NSArray *arr = [bundle loadNibNamed:@”myView” owner:self options:nil]; UIView *myview = [arr objectAtIndex:0]; 手动创建 CGRect viewRect = CGRectMake(0, 0, 100, 100); UIView *myView = [[UIView alloc] initWithFrame:viewRect];

17.弹出确认 UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@”提示” message:@”消息内容” delegate:nil cancelButtonTitle:@”确定” otherButtonTitles:nil] autorelease]; [alertView show]; 18.添加视图和删除视图 addSubview添加子视图 insertSubview:atIndex:视图插入到指定索引位置 insertSubview:aboveSubview:视图插入指定视图之上 insertSubview:belowSubview:视图插入指定视图之下 bringSubviewToFront:视图移动到最顶层 sendSubviewToBack:视图移动到最底层 exchangeSubviewAtIndex:withSubviewAtIndex两个索引对应的视图交换位置 removeFromSuperview:视图从父视图移除 19.视图属性 19.1tag属性标签值 view2.tag = 2;//设置tag属性 UIView *_view = [self.window viewWithTag:2];或者tag为2的视图 其他属性:子视图会继承父视图属性 alpha透明度0.0~1 backgroundColor背景颜色 subviews子视图集合 hidden是否隐藏 superview父视图 multipleTouchEnabled是否开启多点触摸 userInteractionEnabled是否响应触摸事件

20.颜色 [UIColor colorWithRed:75/255 green:23/255 blue:22/255 alpha:1]; [UIColor redColor];

21.自定义UIView SubView *_view = (SubView *)[self.window viewWithTag:110]; 这样view才能使用subview中的方法 这样我们自定义的UIView需要重载dealloc方法进行内存释放

22坐标系统变换(动画使用) 视图缩放 UIView *_view = [self.window viewWithTag:110]; _view.transform = CGAffineTransformScale(_view.transform, 0.8, 0.8);//x,y参数是缩放比例 视图平移 UIView *_view = [self.window viewWithTag:110]; _view.transform = CGAffineTransformTranslate(_view.transform, 20, 20);//平移 视图旋转 UIView *_view = [self.window viewWithTag:110]; _view.transform = CGAffineTransformRotate(_view.transform, 0.2);//旋转角度

23.视图内容模式 内容填充 imageView1.contentMode = UIViewContentModeScaleAspectFit; 等多种属性 view.clipsToBounds = YES超出的部分会被隐藏

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2013年5月5日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档