UIView介绍-创新互联
1.什么是视图
当前题目:UIView介绍-创新互联
URL分享:http://www.pengzhouwz.cn/article/deojph.html

视图是屏幕上的一个矩形区域。它有两个用途:第一个用途是在上面绘制内容,第二个用途是处理事件。

2.视图在iphone上是分层排列的,每个视图只有一个父视图,但有零个或多个子视图。
3.UIWindow是唯一没有父视图的视图,一个应用只有一个UIWindow。
4.操作视图层次的方法
- (void)addSubView:(UIView *)view;
- (void)removeFromSuperview;
- (void)insertSubView:(UIView *)view atIndex:(int)index;
- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview;
- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;5.视图相关的结构体
CGPoint CGSize CGRect
6.frame与bounds的区别
frame是视图在其父视图坐标系统中的大小和位置
bounds是视图在自身坐标系中的大小和位置
7.自定义视图,需要重写
- (void)drawRect:(CGRect)rect;
但永远不要直接调用上面的方法,而是调用下面的方法来通知系统重画视图
- (void)setNeedsDisplay;
8.处理事件的方法
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; 当前题目:UIView介绍-创新互联
URL分享:http://www.pengzhouwz.cn/article/deojph.html
其他资讯
- 使用JavaScript在Web浏览器中获取当前URL的方法-创新互联
- 安装php模块eaccelerator缓存加速模块报错-创新互联
- 域名注册商解析设置,百度域名注册与解析服务
- SpringBoot2整合FastDFS中间件,实现文件分布式管理
- Linux下怎么破解PHP加密dezend软件
- android享受 androidsupportdesignwidgetnavigationview
- SD卡程序写入Linux操作系统(把sd卡的程序烧写到linux)
- 菲律宾服务器地址(菲律宾服务器怎么样?菲律宾服务器适用哪些网站)
- sqlserver数据库怎么导出表
- msi重装系统识别不到u盘?msiwindowsusb3.0


咨询
建站咨询
