<legend id='6FH5H'><style id='6FH5H'><dir id='6FH5H'><q id='6FH5H'></q></dir></style></legend>

<i id='6FH5H'><tr id='6FH5H'><dt id='6FH5H'><q id='6FH5H'><span id='6FH5H'><b id='6FH5H'><form id='6FH5H'><ins id='6FH5H'></ins><ul id='6FH5H'></ul><sub id='6FH5H'></sub></form><legend id='6FH5H'></legend><bdo id='6FH5H'><pre id='6FH5H'><center id='6FH5H'></center></pre></bdo></b><th id='6FH5H'></th></span></q></dt></tr></i><div id='6FH5H'><tfoot id='6FH5H'></tfoot><dl id='6FH5H'><fieldset id='6FH5H'></fieldset></dl></div>

<small id='6FH5H'></small><noframes id='6FH5H'>

      • <bdo id='6FH5H'></bdo><ul id='6FH5H'></ul>
      <tfoot id='6FH5H'></tfoot>
      1. CALayer 性能与 UIImageView 性能

        CALayer performance vs. UIImageView performance(CALayer 性能与 UIImageView 性能)

              <small id='RU7LX'></small><noframes id='RU7LX'>

              <tfoot id='RU7LX'></tfoot>
            1. <legend id='RU7LX'><style id='RU7LX'><dir id='RU7LX'><q id='RU7LX'></q></dir></style></legend>
                <bdo id='RU7LX'></bdo><ul id='RU7LX'></ul>

                <i id='RU7LX'><tr id='RU7LX'><dt id='RU7LX'><q id='RU7LX'><span id='RU7LX'><b id='RU7LX'><form id='RU7LX'><ins id='RU7LX'></ins><ul id='RU7LX'></ul><sub id='RU7LX'></sub></form><legend id='RU7LX'></legend><bdo id='RU7LX'><pre id='RU7LX'><center id='RU7LX'></center></pre></bdo></b><th id='RU7LX'></th></span></q></dt></tr></i><div id='RU7LX'><tfoot id='RU7LX'></tfoot><dl id='RU7LX'><fieldset id='RU7LX'></fieldset></dl></div>
                  <tbody id='RU7LX'></tbody>
                  本文介绍了CALayer 性能与 UIImageView 性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I'm noticing that some of the things that I do with images in my app, I could be doing with CALayer properties instead (i.e. borders, shadows, gradients, and so on). So I'm wondering, in general, is it a better idea to use CALayers and such, or just do all that stuff in photoshop and use UIImage(View)s for whatever I need? Scrolling performance has been kinda slow with drop shadows and stuff, so I'm basically trying to find every little optimization that I can.

                  Background information: I'm basically just scrolling through a bunch of images, vertically. Somewhat like the photos app. This is all from 3.2 onwards, so I have access to things like the shadow and shouldRasterize properties in CALayer.

                  解决方案

                  A key thing to know about CALayer shadows is that they are, by default, rendered from the layer's composited alpha channel; that can be really slow, particularly when the layer is rotating or changing size. You should look into the shadowPath property: if you give Core Animation a simple shape, such as a rectangle (UIBezierPath +bezierPathWithRect: with the layer's bounds will give you [via its CGPath property] a CGPathRef you can use there), you'll see much better performance.

                  shouldRasterize is also definitely useful, particularly with views that have many subviews that don't change often; make sure, though, that you set the layer's rasterizationScale to [UIScreen mainScreen].scale, or you'll get some nasty pixelation on high-resolution screens like the iPhone 4's.

                  这篇关于CALayer 性能与 UIImageView 性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  WebKit on th iPhone: is it possible to copy text to the clipboad with JavaScript(iPhone上的WebKit:是否可以使用JavaScript将文本复制到剪贴板)
                  When compiling for multiple targets in XCode, how do i ensure that certain files will not be included one target(在 XCode 中为多个目标编译时,我如何确保某些文件不会包含在一个目标中)
                  Selecting text in mobile Safari on iPhone(在 iPhone 上的移动 Safari 中选择文本)
                  Draggable UIImageView Partially Transparent amp; Irregular Shaped(可拖动的 UIImageView 部分透明 amp;不规则形状)
                  How to set the resolution of a saved image from the UIImagePickerController(如何从 UIImagePickerController 设置保存图像的分辨率)
                  Add UIImageview in Uitextview as in iMessage(像在 iMessage 中一样在 Uitextview 中添加 UIImageview)
                    <bdo id='OyeqQ'></bdo><ul id='OyeqQ'></ul>
                  • <small id='OyeqQ'></small><noframes id='OyeqQ'>

                    <i id='OyeqQ'><tr id='OyeqQ'><dt id='OyeqQ'><q id='OyeqQ'><span id='OyeqQ'><b id='OyeqQ'><form id='OyeqQ'><ins id='OyeqQ'></ins><ul id='OyeqQ'></ul><sub id='OyeqQ'></sub></form><legend id='OyeqQ'></legend><bdo id='OyeqQ'><pre id='OyeqQ'><center id='OyeqQ'></center></pre></bdo></b><th id='OyeqQ'></th></span></q></dt></tr></i><div id='OyeqQ'><tfoot id='OyeqQ'></tfoot><dl id='OyeqQ'><fieldset id='OyeqQ'></fieldset></dl></div>

                      <tbody id='OyeqQ'></tbody>

                    1. <tfoot id='OyeqQ'></tfoot>
                          1. <legend id='OyeqQ'><style id='OyeqQ'><dir id='OyeqQ'><q id='OyeqQ'></q></dir></style></legend>