IOS Drewrect method

Source: Internet
Author: User

You don't need to override the This method if your view sets it content in other ways.

By the time this method is called, UIKit have configured the drawing environment appropriately for your view and you can Si Mply call whatever drawing methods and functions your need to render your content. Specifically, UIKit creates and configures a graphics context for drawing and adjusts the transform of that-context so tha T 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 does not establish a str Ong reference to the graphics context because it can change between calls to the Drawrect:method.

This method was called when a view was first displayed or when an event occurs that invalidates a visible part of the VI ew. You should never call this method directly yourself. To invalidate part of your view, and thus cause, portion to being redrawn, call the Setneedsdisplay or SETNEEDSDISPLAYINR Ect:method instead.

The above is an official Apple document.

IOS Drewrect method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.