zoukankan      html  css  js  c++  java
  • UI基础:UI中类的继承关系图,最基本的视图分析

    首先,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);

  • 相关阅读:
    居中
    <script type="text/javascript"></script>
    移动端获取全文高度
    video
    transition animation
    移动端隐藏overflow:auto滚轮
    Vue将组件data内的数据重置
    文字刚刚刚刚刚好的居中
    小程序总结(不断更新)
    vue组件之间的传值
  • 原文地址:https://www.cnblogs.com/shaoting/p/4620413.html
Copyright © 2011-2022 走看看