iphone - CALayer or UIView backgroundColor UIImage on iOS 4 -
good day all;
i not sure has changed prevent working. on ios 3 sdk, following code worked fine in catiledlayer class:
- (void)drawincontext:(cgcontextref)context { uiimage* image = [[resourcesmanager sharedresourcesmanager] getuiimagefromarray:image_cell_background index:[mazecell zone]]; uicolor* color = [[uicolor alloc] initwithpatternimage:image]; [self setbackgroundcolor:[color cgcolor]]; [color release];
however, compiling ios 4 , executing on simulator fails render image. baffled since images added sublayers render fine. background doesn't render.
ok after spending few days on have come work-around.
firstly, tried doing in uiview , still had same issues. tried other types of gui components have backgroundcolor property.
they produced same issue. can tell, appears bug , new image loading / caching process implemented interprets whether or not use hd or sd graphics.
basically, workaround load background image subview or sublayer (depending on implementation) , either send (bottom of hierarchy) or load first before other subview/sublayer.
perhaps backgournd images in ios 3 wherey doing within view/layer , perhaps apple decided not double handle background image versus subview/sublayer , removed support it.
however, @ least can set background color or transparent color. have verified this.
at rate, use workaround until either apple explains why made decision or fix sdk handle it. keen learn apple developer forums have said issue (i has been raised). not part of program yet still in alpha stage, once beta, register.
Comments
Post a Comment