iphone - iOS 5.1 : -[UIColor colorWithPatternImage:] background color draws solid black -


while testing application in today's release of ios 5.1 gm, noticed of views drawing solid black rather patterned background color. exact same code works fine on previous ios releases (tested on 4.2 - 5.0.1).

see screenshots: screenshots of issue

has else experienced this? there workaround?

answering own question (it took me few days debug this, saves else time ;) ):

the root cause involves using patterned uicolor (via +[uicolor colorwithpatternimage:]) background color on uiview above uiimageview same image.

example:

    uiimageview *imageview = [[uiimageview alloc] initwithimage:animage];     [_containerview addsubview:imageview];      uicolor *patterncolor = [uicolor colorwithpatternimage:animage];     uiview  *patternview = [[uiview alloc] initwithframe:frame];     [patternview setbackgroundcolor:patterncolor];     [_containerview addsubview:patternview]; 

both views draw black, , there appears caching issue other uses of image draws black until application suspended/resumed.

i filed issue #10795514 apple report this, looks made 5.1. reduction of problem available at: http://iccir.com/public/radar/radar10795514.zip

the workaround found flatten view hierarchy , draw pattern image twice in same view.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -