首页 > 其他 > 详细

UI基础:UI中类的继承关系图,最基本的视图分析

时间:2015-07-04 12:30:25      阅读:227      评论:0      收藏:0      [点我收藏+]

技术分享

首先,UI中常用的UIwindow.UILabel.UIButton.UITextField属于UIView的子类.UITextField和UILabel和UIwindow自身没有初始化方法,需要使用父类的UIView的初始化方法initWithframe,UIbutton有自己的初始化方法buttonWithType:<#(UIButtonType)#>.因为UITextField和UILabel和UIWindow都需要alloc,所以它们都需要release方法,而UIButton则不需要.

 

UIWindow属于窗口类.它的大小一般和主屏幕大小一致.

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

 

UIView  视图类

以UIView为例说明:

- (instancetype)initWithFrame:(CGRect)frame;

 

struct CGRect {

  CGPoint origin;

  CGSize size;

};

 

 

 

 

struct CGPoint {

  CGFloat x;

  CGFloat y;

};

typedef struct CGPoint CGPoint;

 

struct CGSize {

  CGFloat width;

  CGFloat height;

};

typedef struct CGRect CGRect;

 

 

 

CG_INLINE CGPoint CGPointMake(CGFloat x, CGFloat y);

 

 

 

CG_INLINE CGSize CGSizeMake(CGFloat width, CGFloat height);

 

UI基础:UI中类的继承关系图,最基本的视图分析

原文:http://www.cnblogs.com/shaoting/p/4620413.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!