iPhone UIView
来源:互联网 发布:淘宝密码找回密码页面 编辑:程序博客网 时间:2024/05/29 03:17
NSObject
UIResponder
UIView
UIWindow
UILabel
UIPickerView
UIProgressView
UIImageView
UITabBar
UIToolBar
UINavigateBar
UITableViewCell
UIActionSheet
UIAlertView
UIScrollView --UITableView,UITextView
UISearchBar
UIWebView
UIControl
UIButton
UIDatePicker
UIPageControl
UISegmentedControl
UITextField
UISlider
UISwithgj
概述
UIView对象在屏幕中定义了一个复杂区域和界面来管理这个区域的内容。
视图的职责:
- 画图和动画。
- 布局和子视图管理。
- 事件处理。
1、创建一个视图对象
2、动画
改变一些视图属性将会使用到动画,改变属性时创建一个动画,用于给用户传递在较短时间内的变化。UIView类做了动画展现的大部分工作,但是你仍然需要声明哪种属性改变的时候,你需要动画效果。有两种不同的类型来初始化动画。
下面的UIView属性支持动画:
frame,bounds,center,transform,alpha,backgroundColor,contentStretch
在iOS 4之后,使用block-based动画方法(推荐使用),使用 开始/提交方式(begin/commit)。
3、管理视图的层次结构
superview属性:
subviews属性:
window属性:
- addSubview方法
- bringSubviewToFront:(UIView *)veiw方法,将view视图移到层次结构的最顶端,使得其得以展示
- sendSubviewToBack:(UIView *)veiw方法,和上面方法正好相反
- removeFromSupview方法,
- insertSubview:(UIView *)view atIndex:(Interger)index方法
- insertSubview:(UIView *)view aboveSubview(UIView *)siblingView 方法
- insertSubview:(UIView *)view belowSubview(UIView *)siblingView 方法
- exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2方法
- isDescendantOfView:(UIView *)view方法,判断view是不是指定视图的子视图
4、子视图的布局(layout)
- layoutSubviews方法,这个方法,默认没有做任何事情,需要子类进行重写
- setNeedsLayout方法
- layoutIfNeeded方法,立即对子视图进行布局
5、画/更新视图
- drawRect:(CGRect)rect方法
- setNeedsDisplay
- setNeedsDisplayInRect:(CGRect)invalidRect方法
6、以块展现动画的方式(animating views with block)
- animateWithDuration:delay:options:animations:completion:
- animateWithDuration:animations:completion:
- animateWithDuration:animations:
- transitionWithView:duration:options:animations:completion:
- transitionFromView:toView:duration:options:completion:
7、在视图和坐标系统之间转换
- convertPoint:toView
- convetPoint:fromView
- convertRect:toView
- convertRect:fromView
8、跟踪视图相关的改变
- didAddSubview:
- willRemoveSubview:
- willMoveToSuperview
- didMoveToSuperview
- willMoveToWindow:
- didMoveToWindow
- iPhone UIView
- [iPhone] UIView FAQ
- iPhone-UIView 讲解
- Iphone中的UIView开发
- iPhone UIView 详解
- iphone UIView 详解
- UIView - iPhone Development Wiki
- [IPhone] UIView与内存管理
- IPhone之UIView中动画
- IPhone之UIView中动画
- iphone--UIView翻转效果实现
- iphone学习笔记 – UIView
- IPhone之UIView中动画
- iPhone/iOS UIView开发总结
- iPhone 的 UIView的学习
- Iphone中的UIView开发 (转)
- iPhone/iOS UIView开发总结
- iphone UIView draw layer on picture
- 社会交际系统的启动按钮" 之 "一起去吃饭吧!"
- android:descendantFocusability用法简析
- 第十二周 C# 试验 《 3 》 .
- Linux下Apache无法解析.php文件
- 网络编程相关概念
- iPhone UIView
- linux中cat命令;解压缩命令
- MFC连接ACCESS数据库心得
- Android启动
- SQL Server 2008 安装程序支持文件时中断
- ldap的配置
- Linux GNU 编译基础知识
- 标准C的标记化结构初始化语法
- oracle中sequence序列的使用