开发者

ipad memory warning on huge patternimage

开发者 https://www.devze.com 2023-02-20 19:06 出处:网络
I have built a zo开发者_如何学运维omable scrollview with a pattern image background. cntView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@\"patternStripe.png\"]];

I have built a zo开发者_如何学运维omable scrollview with a pattern image background.

cntView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"patternStripe.png"]];

the scrollview is very long and zoomable.

and of coure: i recieve memory warnings (lvl 1 & 2)

is there a workaround to have pattern images in large zoomable views?


Either find a way to reduce the size of the pattern. Does it really need to be 1800px in height, is there no repetition in that pattern already ?

Or you will have to split the pattern background up into smaller images and create a view that draws them as needed and use that view as background/parent view for your content. See for example this question and this question.

Apple says to avoid images larger than 1024x1024, and while this doesn't exactly fit your image, the fact that you use it as a pattern where it is copied a lot in whole before getting cropped likely breaks the barrier.

0

精彩评论

暂无评论...
验证码 换一张
取 消