zoukankan      html  css  js  c++  java
  • View Architecture Fundamentals

    A view object defines a rectangular region on the screen and handles the drawing and touch events in that region. A view can also act as a parent for other views and coordinate the placement and sizing of those views. The UIView class does most of the work in managing these relationships between views, but you can also customize the default behavior as needed.

     

    UIView<-->CALayer

    Views work in conjunction with Core Animation layers to handle the rendering and animating of a view’s content. Every view in UIKit is backed by a layer object (usually an instance of the CALayer class), which manages the backing store for the view and handles view-related animations. Most operations you perform should be through the UIView interface. However, in situations where you need more control over the rendering or animation behavior of your view, you can perform operations through its layer instead.

     

     layer object ->Core Animation rendering object -> the hardware buffers

    Behind those layer objects are Core Animation rendering objects and ultimately the hardware buffers used to manage the actual bits on the screen.

     

    Changing the size of a parent view has a ripple effect that can cause the size and position of any subviews to change too. When you change the size of a parent view, you can control the resizing behavior of each subview by configuring the view appropriately. Other changes that affect subviews include hiding a superview, changing a superview’s alpha (transparency), or applying a mathematical transform to a superview’s coordinate system.

     

    The arrangement of views in a view hierarchy also determines how your application responds to events. When a touch occurs inside a specific view, the system sends an event object with the touch information directly to that view for handling. However, if the view does not handle a particular touch event, it can pass the event object along to its superview. If the superview does not handle the event, it passes the event object to its superview, and so on up the responder chain. Specific views can also pass the event object to an intervening responder object, such as a view controller. If no object handles the event, it eventually reaches the application object, which generally discards it.

  • 相关阅读:
    c++程序—冒泡排序法(函数、指针)
    c++程序—统计成绩
    c++程序—冒泡排序法
    c++程序—逆置
    c++程序—五只小猪称体重
    c++程序—goto
    c++程序—乘法表
    c++程序—循环嵌套
    RGB保存 .bmp文件踩坑记
    vdi文件扩容
  • 原文地址:https://www.cnblogs.com/cocoabanana/p/5555320.html
Copyright © 2011-2022 走看看