While an UIView has a memory footprint of at least 4 * width * height pixels, I wonder how that would look when I create a CALayer only.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
Having done some experimenting around this in the past, I found that the added overhead of the UIView object was very minimal.
This statement is absolutely not true. The memory overhead of a UIView (compared to a CALayer) is just the size of the instance variables of the UIView class, plus a few instances of additional classes that will get allocated. The UIView instance variables take up about 24 bytes, and the additional data storage is probably the same, or less.
If UIView adds functionality that's useful for your application, then use it. The memory overhead is really of no concern.