Saturday, 15 June 2013

iphone - UIView opaque property is ignored when implementing drawRect: -



iphone - UIView opaque property is ignored when implementing drawRect: -

i have uiview subclass overrides drawrect: accomplish various effects (gradient background, rounded corners different radii, etc). when profile app , enable color blended layers in simulator/instruments, instances of class never green, if drawing solid gradient , has opaque property set yes. there special have in drawrect: in order property respected?

may should set "opaque" property no , apple doc :

an opaque view expected fill bounds exclusively opaque content—that is, content should have alpha value of 1.0. if view opaque , either not fill bounds or contains wholly or partially transparent content, results unpredictable. should set value of property no if view or partially transparent.

so in drawrect method , if draw opaque layer , should create sure the view's opaque property's value set no.

uiview reference

iphone ios objective-c xcode ipad

No comments:

Post a Comment