zoukankan      html  css  js  c++  java
  • iOS drewRect方法

    You do not need to override this method if your view sets its content in other ways.

    By the time this method is called, UIKit has configured the drawing environment appropriately for your view and you can simply call whatever drawing methods and functions you need to render your content. Specifically, UIKit creates and configures a graphics context for drawing and adjusts the transform of that context so that its origin matches the origin of your view’s bounds rectangle. You can get a reference to the graphics context using the UIGraphicsGetCurrentContext function, but do not establish a strong reference to the graphics context because it can change between calls to the drawRect: method.

    This method is called when a view is first displayed or when an event occurs that invalidates a visible part of the view. You should never call this method directly yourself. To invalidate part of your view, and thus cause that portion to be redrawn, call the setNeedsDisplay or setNeedsDisplayInRect: method instead.

    以上摘自苹果官方文档。

     
  • 相关阅读:
    观察者模式
    php中compact,extract,list函数的使用
    加密解密
    python 线程池proxypool
    python qq音乐下载
    python 网易云音乐
    python 知识点
    python 格式化 header
    python 爬取百度图片
    php 过滤掉多维数组空值
  • 原文地址:https://www.cnblogs.com/renlipeng/p/4559062.html
Copyright © 2011-2022 走看看