The difference between self and self.contentview in the iOS development cell

Source: Internet
Author: User

In general, we add a child view to the cell in two ways:


1, [cell Addsubview:]

2, [Cell.contentview Addsubview:]

The difference is in cell editing, such as cell content to move to the left or right, the first way the child view does not move, the second can, so this situation generally use the second way.

Also when setting backgroundcolor, use the cell settings when the left or right to move the color will not change, and with Cell.contentcell settings, the mobile blank will show the cell's default color, this situation depends on the actual choice.

Related Article

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.