I'm displaying opaque PNGs with UIImageView
s inside of a superview with a white background color. What's best for performance?
UIImageView
Defaults
opaque = NO
, backgroundColor = nil
, clearsContextBeforeDrawing = YES
.
iOS Developer Library: UIView
Class Reference
UIView Class Reference: backgroundColor says, "[
nil
] results in a transparent background color." If I set aUIView
sopaque
property toYES
, must I also set itsbackgroundColor
to[UIColor clearColor]
, or is that extra line of code & processing unnecessary? I.e., is[UIColor clearColor]
considered opaque (not transparent)?Does the value of
clearsContextBeforeDrawing
matter for opaque views?The comments for
clearsContextBeforeDrawing
inUIView.h
say it's ignored for opaque views.But, UIView Class Reference: clearsContextBeforeDrawing says:
If the view’s
opaque
property is also set toYES
, thebackgroundColor
property of the view must not benil
or drawing errors may occur.Which is it?
Similar Questions
- Is UIView's opaque property with a value of YES in conflict with its backgroundColor property with a value of [UIColor clearColor]?
- Cocoa/iPhone: BackgroundColor and Opaque Properties