Try to set view as Opaque,ios development tips

Source: Internet
Author: User

Transferred from: http://www.tiboo.cn/dianzijie/b1837169/
iOS devices have some limitations and developers can only strive to keep them perfect. Each stage of the development of iOS and encountered a lot of problems, developers and experts are also constantly experience, with you to share the experience and experience.
Here is a little bit of development skills, hope to be helpful to everyone.
Note that you should first try to set the view to opaque, and if the view is opaque, set its opaque property to Yes.
Why do you want to do this? There is a certain reason for it, let's have a look. Setting up iOS allows the system to draw the view in an optimal way. The opaque property can be set in Interface Builder or code.
Apple's official documentation for the opaque attribute is interpreted as follows: This property provides a hint to
He drawing system as to how it should treat the view. If set to YES,
The drawing system treats the view as fully opaque, which allows the
Rawing system to optimize some drawing operations and improve
Performance. If set to NO, the drawing system composites the View
Normally with other content. The default value of the IS YES.
(The Opaque property hints at how the system handles view.) If opaque is set to Yes, the drawing system will
View is completely opaque, so the drawing system can optimize some drawing operations to improve performance. If you set
For no, the drawing system combines other content to handle the view. By default, this property is yes. )
If the screen is still, the setting of this opaque property is not a big problem. However, if
View is embedded in the scroll view, or is part of a complex animation, and does not set this property
Will certainly affect the performance of the program!
You can see which view is not set to opaque through the emulator's Debug\color blended layers option. For the performance of the program, set the view as opaque as possible!

Try to set view as Opaque,ios development tips

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.