The difference between Calayer and UIView

Source: Internet
Author: User


The main expression of this article is the difference between these two classes and a small number of links.


1. The first thing to be clear is that Calayer inherits from NSObject, and UIView is integrated from Nsresponder. So uiview can be the corresponding user's Click event, and Calayer more is to do rendering and animation effects.

2. The second is that both Calayer and UIView can be displayed on the screen. What's the difference? Of course! Each uiview that is displayed on the page is drawn on its own root layer! It's like a layer is an artboard, and view is a brush.

3. The third is that both of them have no significant difference in the efficiency of their presentation. However, it is still recommended to use DrawRect in Tableviewcell instead of subviews to draw the cell.



The difference between Calayer and UIView

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.