zoukankan      html  css  js  c++  java
  • ios 的frame,bound,center

    frame:指的是视图在父视图的坐标系统中的大小和位置。

    bound:指的是视图在试图本身的坐标系统中的大小(位置起点是原点)。
    center:指的是视图在父视图坐标系统中的中心点。
    贴张苹果官网的图:
    frame和bound的关系
    Relationship between a view's frame and bounds
     
    下面这是其中一个发生变化,其余两个的变化,直接看吧,很浅显。
     

    Although you can change the framebounds, and center properties independent of the others, changes to one property affect the others in the following ways:

    • When you set the frame property, the size value in the bounds property changes to match the new size of the frame rectangle. The value in the center property similarly changes to match the new center point of the frame rectangle.

    • When you set the center property, the origin value in the frame changes accordingly.

    • When you set the size of the bounds property, the size value in the frame property changes to match the new size of the bounds rectangle.

    By default, a view’s frame is not clipped to its superview’s frame. Thus, any subviews that lie outside of their superview’s frame are rendered in their entirety. You can change this behavior, though, by setting the superview’s clipsToBounds property to YES. Regardless of whether or not subviews are clipped visually, touch events always respect the bounds rectangle of the target view’s superview. In other words, touch events occurring in a part of a view that lies outside of its superview’s bounds rectangle are not delivered to that view.

  • 相关阅读:
    JavaScript Array filter() 方法
    Object.assign方法的使用入门
    使用ES6新特性async await进行异步处理
    win10系统怎么设置软件开机启动
    【ES6学习笔记之】Object.assign()高级编程
    如何使用闭包形成计数器
    多次调用settimeout 如何使用单例模式
    在线表单设计器现在已经开源
    VisualStudio2017集成GitHub
    PHP使用curl替代file_get_contents
  • 原文地址:https://www.cnblogs.com/xubojoy/p/3873907.html
Copyright © 2011-2022 走看看