UIKit 框架之UIView一
- (id)initWithFrame:(CGRect)aRect //通过一个矩形对象初始化
Configuring a View’s Visual Appearance //配置视觉展示
@property(nonatomic, copy) UIColor *backgroundColor //设置背景色
@property(nonatomic, getter=isHidden) BOOL hidden //隐藏view,默认为NO
@property(nonatomic) CGFloat alpha //设置透明度,0.0至1.0区间
@property(nonatomic, getter=isOpaque) BOOL opaque //告诉系统渲染器view是否不透明,设置YES可以加快渲染,默认为YES,如果设置了alpha值,应该设置为NO
@property(nonatomic) BOOL clipsToBounds //是否裁剪超出边界的视图,与css中overflow类似,默认为NO
@property(nonatomic) BOOL clearsContextBeforeDrawing //是否清除缓冲区中不可见内容,默认为YES,如果在一个滚动操作频繁的视图中,应该设为NO,以避免重新渲染,提升性能
+ (Class)layerClass //可以返回主layer所使用的类,UIView的子类可以通过重载这个方法,来让UIView使用不同的CALayer来显示
@property(nonatomic, readonly, retain) CALayer *layer //返回Core Animation层所使用的渲染方式
Configuring the Event-Related Behavior //配置事件关系
@property(nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled //设置view是否响应用户事件,如touch、keyboard,默认为YES
@property(nonatomic, getter=isMultipleTouchEnabled) BOOL multipleTouchEnabled //设置view是否响应多点触摸,默认为NO
@property(nonatomic, getter=isExclusiveTouch) BOOL exclusiveTouch //设置touch是否排它,默认为NO
Configuring the Bounds and Frame Rectangles //配置边界和矩形框架
@property(nonatomic) CGRect frame //设置view框架
@property(nonatomic) CGRect bounds //设置view边界
@property(nonatomic) CGPoint center //设置中心点
@property(nonatomic) CGAffineTransform transform //设置transform,与css类似,CGAffineTransform是个矩阵结构体
Managing the View Hierarchy //管理视图层级
@property(nonatomic, readonly) UIView *superview //返回父view,只读
@property(nonatomic, readonly, copy) NSArray *subviews //返回子view集合,只读
@property(nonatomic, readonly) UIWindow *window //返回window对象,只读
- (void)addSubview:(UIView *)view //添加一个子view到view中
- (void)bringSubviewToFront:(UIView *)view //把一个子view位置移动到列表最前
- (void)sendSubviewToBack:(UIView *)view //把一个子view位置向后移动一格
- (void)removeFromSuperview //把调用该方法的view从其父view中移除
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index //插入一个子view到指定索引,从0开始
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview //插入一个子view到指定view之前
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview //插入一个子view到指定view之后
- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2 //交换两个view的索引
- (BOOL)isDescendantOfView:(UIView *)view //判断是不是指定元素的子节点或是其本身
Configuring the Resizing Behavior //配置尺寸改变行为
@property(nonatomic) UIViewAutoresizing autoresizingMask //当父元素窗口尺寸改变时,子节点如何去自适应变化
@property(nonatomic) BOOL autoresizesSubviews //子view是否自适应变化,默认为YES
@property(nonatomic) UIViewContentMode contentMode //view自适应变化的方式
- (CGSize)sizeThatFits:(CGSize)size //传递view的尺寸,返回建议的子view尺寸
- (void)sizeToFit //调整view的尺寸去适应其内容
Laying out Subviews //布局子节点
- (void)layoutSubviews //布局子view
- (void)setNeedsLayout //在下次更新中刷新布局
- (void)layoutIfNeeded //立即刷新布局
Opting in to Constraint-Based Layout //选择约束布局的方式
+ (BOOL)requiresConstraintBasedLayout //返回view是否是约束布局模式,ios6
- (BOOL)translatesAutoresizingMaskIntoConstraints //返回一个BOOL,判断自动布局是否可为转换约束布局,ios6
- (void)setTranslatesAutoresizingMaskIntoConstraints:(BOOL)flag //设置在约束布局系统中是否把自动布局转换为约束布局,ios6
Managing Constraints //约束管理
- (NSArray *)constraints //返回view的约束句柄,ios6
- (void)addConstraint:(NSLayoutConstraint *)constraint //添加约束句柄,ios6
- (void)addConstraints:(NSArray *)constraints //添加约束句柄数组,ios6
- (void)removeConstraint:(NSLayoutConstraint *)constraint //删除约束句柄,ios6
- (void)removeConstraints:(NSArray *)constraints //删除约束句柄数组,ios6
Measuring in Constraint-Based Layout //测量约束布局
- (CGSize)systemLayoutSizeFittingSize:(CGSize)targetSize //返回最合适的尺寸,ios6
- (CGSize)intrinsicContentSize //返回view的自然尺寸,ios6
- (void)invalidateIntrinsicContentSize //使内容尺寸无效化,ios6
- (UILayoutPriority)contentCompressionResistancePriorityForAxis:(UILayoutConstraintAxis)axis //待补充,ios6
- (void)setContentCompressionResistancePriority:(UILayoutPriority)priority forAxis:(UILayoutConstraintAxis)axis //待补充,ios6
- (UILayoutPriority)contentHuggingPriorityForAxis:(UILayoutConstraintAxis)axis //待补充,ios6
- (void)setContentHuggingPriority:(UILayoutPriority)priority forAxis:(UILayoutConstraintAxis)axis //待补充,ios6
Aligning Views with Constraint-Based Layout //校准约束布局
- (CGRect)alignmentRectForFrame:(CGRect)frame //待补充,ios6
- (CGRect)frameForAlignmentRect:(CGRect)alignmentRect //待补充,ios6
- (UIEdgeInsets)alignmentRectInsets //待补充,ios6
- (UIView *)viewForBaselineLayout //待补充,ios6
Triggering Constraint-Based Layout //触发约束布局
- (BOOL)needsUpdateConstraints //返回约束布局是否需要更新,YES为是,ios6
- (void)setNeedsUpdateConstraints //更新约束布局,ios6
- (void)updateConstraints //更新约束布局,ios6
- (void)updateConstraintsIfNeeded //更新约束布局及其子布局,ios6
Debugging Constraint-Based Layout //调试约束布局
- (NSArray *)constraintsAffectingLayoutForAxis:(UILayoutConstraintAxis)axis //待补充,ios6
- (BOOL)hasAmbiguousLayout //待补充,ios6
- (void)exerciseAmbiguityInLayout //待补充,ios6
Drawing and Updating the View //绘制和更新视图
- (void)drawRect:(CGRect)rect //在view中绘制一个矩形
- (void)setNeedsDisplay //使view重绘
- (void)setNeedsDisplayInRect:(CGRect)invalidRect //指定矩形重绘
@property(nonatomic) CGFloat contentScaleFactor //待补充
Formatting Printed View Content //格式化内容
- (UIViewPrintFormatter *)viewPrintFormatter //返回view的打印对象
- (void)drawRect:(CGRect)area forViewPrintFormatter:(UIViewPrintFormatter *)formatter //使用某个区域来打印
Managing Gesture Recognizers //管理手势
- (void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer //添加手势识别器
- (void)removeGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer //删除手势识别器
@property(nonatomic, copy) NSArray *gestureRecognizers //获取手势集合
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer //通过返回值决定是否识别此手势
Animating Views with Blocks //使多个view执行动画
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion //使一个或多个view执行动画
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion //使一个或多个view执行动画
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations //使一个或多个view执行动画
+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion //在一个view上创建过渡动画
+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion //
Animating Views //view动画
+ (void)beginAnimations:(NSString *)animationID context:(void *)context //标志动画代码开始
UIKit 框架之UIView一的更多相关文章
- UIKit 框架之UIView二
下面这些都是UIView一些基本的东西,具体的可以参考UIKit 框架之UIView一博客 一.自定义一个View // // MyView.m // UIView // // Created by ...
- iOS开发概述UIkit动力学,讲述UIKit的Dynamic特性,UIkit动力学是UIkit框架中模拟真实世界的一些特性。
转发:http://my.oschina.net/u/1378445/blog/335014 iOS UIKit动力学 Dynamics UIAttachmentBehavior 实现iMessage ...
- 79、iOS 的Cocoa框架、Foundation框架以及UIKit框架
Cocoa框架是iOS应用程序的基础 1. Cocoa是什么? Cocoa是 OS X和ios 操作系统的程序的运行环境. 是什么因素使一个程序成为Cocoa程序呢?不是编程语言,因为在Cocoa开发 ...
- UIKit框架使用总结--看看你掌握了多少
一.经常使用的,基本就是每次项目迭代都需要使用的 UIView.UILabel.UIImage.UIColor.UIFont.UIImageView.UITextField.UIButton. UIS ...
- Swift - 重写UIKit框架类的init初始化方法(以UITabBarController为例)
原来写了篇文章讲UITabBarController的用法,当时是从UIViewController跳转到UITabBarController页面,代码如下: 1 self.presentViewCo ...
- UIKit框架
在今后的应用程序构建中,会陆续使用各式各样的控件,因此UIKit框架的引入是必不可少的! 一.简介 UIKitk框架提供一系列的Class(类)来建立和管理iPhone OS应用程序的用户界面接口.应 ...
- iOS学习32之UIKit框架-可视化编程-XIB
1. Interface Builder 可视化编程 1> 概述 GUI : 图形用户界面(Graphical User Interface, 简称GUI, 又称图形化界面) 是指采用图形方式显 ...
- 基础框架Fundation和UIkit框架的定义和使用
Foundation 框架为所有应用程序提供基本的系统服务 您的应用程序以及 UIKit 和其他框架,都建立在 Foundation 框架的基础结构之上.Foundation 框架提供许多基本的对象类 ...
- iOS开发UIKit框架-可视化编程-XIB
1. Interface Builder 可视化编程 1> 概述 GUI : 图形用户界面(Graphical User Interface, 简称GUI, 又称图形化界面) 是指采用图形方式显 ...
随机推荐
- Android-Java-Thread线程两种方式的使用场景
Thread线程两种方式的优点/缺点 extends Thread 方式: 缺点:存在耦合度(因为线程任务run方法里面的业务逻辑 和 线程启动耦合了) 缺点:Cat extends Thread { ...
- AlexNet详解2
此处以caffe官方提供的AlexNet为例. 目录: 1.背景 2.框架介绍 3.步骤详细说明 5.参考文献 背景: AlexNet是在2012年被发表的一个金典之作,并在当年取得了ImageNet ...
- SignalR2简易数据看板演示
软件环境: 1.vs2015.windows7..net4.5 演示说明: 当点击按钮的时候,柱状图数值加1并实时变化 1.首先打开vs2015创建一个mvc项目,并安装SignalR2,具体操作可参 ...
- 【文文殿下】NOIp2018游记
Day-1 本段更新于 2018年11月8日23:26:44 今天还在机房里面,无所事事吧.上午睡了一上午,出去理了一下发,花了20块钱 QAQ. 下午来到机房,复习了一下exgcd的东西. 发现自己 ...
- Swift 里 Array (三) Inspecting an Array
判断是否为空 使用的是Collection协议里isEmpty的判断. public var isEmpty: Bool { return startIndex == endIndex } start ...
- 阿里云RDS数据库备份文件恢复到本地数据库
参考这里:https://help.aliyun.com/knowledge_detail/41817.html 第4.2步要多注释掉一些(应该根据实际报错来注释): [mysqld] innodb_ ...
- [LeetCode] Z字型变换
题目内容: 将字符串 "PAYPALISHIRING" 以Z字形排列成给定的行数: P A H N A P L S I I G Y I R 之后从左往右,逐行读取字符:" ...
- 基于GTK+3 开发远程控制管理软件(C语言实现)系列三 Windows7开发环境搭建
一.介绍与准备 考虑到目标客户端基本都是windows客户端,所以此次开发环境将搭建在windows7下,相关开发工具有Msys2 和 Eclipse For C/C++ Msys2 是msys的升级 ...
- 图片训练:使用卷积神经网络(CNN)识别手写数字
这篇文章中,我们将使用CNN构建一个Tensorflow.js模型来分辨手写的数字.首先,我们通过使之“查看”数以千计的数字图片以及他们对应的标识来训练分辨器.然后我们再通过此模型从未“见到”过的测试 ...
- JDK8 - Function介绍
注:写这个文档只是为了方便加深记忆,加强理解,重点关注两个default方法中泛型[V]. JDK8作为一个还在维护阶段的长期版本,势必会在企业应用中占据相当大的市场份额,所以还是以JDK8作为例子的 ...