01 2016 档案
摘要:1.contentSize幕布实际大小决定滚动的方向,如果小于图片本身不滚动,默认也是不滚动 view.contentSize = CGSizeMake(1280, 200); 而frame只是用来显示UIScrollView的显示区域的大小用户看的到的。 2.页面效果,图片不可以停留在两张图中间
阅读全文
摘要:1.创建一个UINavigationController self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; FirstViewController * first = [[FirstViewCont
阅读全文
摘要:UIGestureRecognizer: 1.locationinView 获取手势在某个视图里面的坐标位置 2.delegate监听手势的行为 3.state状态 开始:UIGestureRecognizerStateBegan 手势达到要求 识别:UIGestureRecognizerState
阅读全文
摘要:效果图首先你得画出这只眼睛,这是眼睛包括5个部分组成:1 @property (strong, nonatomic) CAShapeLayer *eyeFirstLightLayer;2 @property (strong, nonatomic) CAShapeLayer *eyeSecondLig...
阅读全文
摘要:#import "ViewController.h"@interface ViewController ()@property (nonatomic,strong) CALayer *hourLayer;@property (nonatomic,strong) CALayer *minLayer;@...
阅读全文
摘要://显隐 CABasicAnimation *capacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; capacityAnimation.fromValue = @1; capacityAnimation.t...
阅读全文
摘要:1.头尾式动画开启动画[UIView beginAnimations:nil context:nil];设置动画执行时间[UIView setAnimationDuration:0.5];---动画的内容---提交动画[UIView commitAnimations];2.block式动画[UIVi...
阅读全文
摘要:1.KVCKVC是Key-Value-Coding的简称,它是一种可以直接通过字符串的名 字(key)来访问类属性(实例变量)的机制。而不是通过调用Setter、Getter方法访问。当使用KVO、Core Data、CocoaBindings、AppleScript(Mac支持)时,KVC是关键技...
阅读全文
摘要:1.单例模式的要点: 显然单例模式的要点有三个;一是某个类只能有一个实例;二是它必须自行创建这个实例;三是它必须自行向整个系统提供这个实例。2.单例模式的优点: 1.实例控制:Singleton 会阻止其他对象实例化其自己的 Singleton 对象的副本,从而确保所有对象都访问唯一实例。 2...
阅读全文
摘要:一.ImageView实现旋转小动画注意:参数为弧度,不要忘记除数加.0[UIViewanimateWithDuration:0.3animations:^{ self.addImageView.transform=CGAffineTransformMakeRotation(45/180.0*M...
阅读全文
摘要:UITabBarController是IOS中很常用的一个viewController。UITabBarController通常作为整个程序的rootViewController,而且不能添加到别的container viewController中.一.创建最常见的创建UITabBarControl...
阅读全文
摘要:1.contentModeview.contentMode = UIViewContentModeScaleAspectFill;2.是否实现触摸 3.简单实现动画 图片的名字为campFire01-campFire17 NSMutableArray * imagearray = [NSMutabl...
阅读全文
摘要:1.默认文本 _loginTextField.placeholder = @"QQ号/手机";2.设置边框 _loginTextField.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderSty...
阅读全文
摘要:RTLabel和RegexKitLite都要导入第三方库 使用Regexkitlite库进行正则表达式的解析 1.库是使用MRR,如果在ARC工程里面使用这个类,必须在project->build phases->compile resources里面将regexKitLite.m的编译...
阅读全文
摘要:UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, 300, 100)];1.设置文字颜色 label.textColor = [UIColor orangeColor]; label2...
阅读全文
摘要:1.Button的定义 UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];Button有六种类型 enum { UIButtonTypeCustom = 0, 自定义风格 UIButtonTypeRounde...
阅读全文
摘要:iOS 最新版 CocoaPods 的安装流程1.移除现有Ruby默认源$gem sources --remove https://rubygems.org/2.使用新的源$gem sources -a https://ruby.taobao.org/3.验证新源是否替换成功$gem sources...
阅读全文
摘要:什么是代理? 苹果的官方文档给了很清晰的解释: Delegation is a simple and powerful pattern in which one object in a program acts on behalf of, or in coordination with, ano...
阅读全文
摘要:模型-视图-控制器(Model-View-Controller,MVC)是Xerox PARC在20世纪80年代为编程语言Smalltalk-80发明的一种软件设计模式,至今已广泛应用于用户交互应用程序中。在iOS开发中MVC的机制被使用的淋漓尽致,充分理解iOS的MVC模式,有助于我们程序的组...
阅读全文
摘要:一、生命周期当一个视图控制器被创建,并在屏幕上显示的时候。代码的执行顺序1、alloc 创建对象,分配空间2、init(initWithNibName) 初始化对象,初始化数据3、loadView 从nib载入视图,通常这一步不需要去干涉。除非你没有使用xib文件创建视图4、vie...
阅读全文

浙公网安备 33010602011771号