0

I have built a zoomable 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?

Eimantas
  • 48,927
  • 17
  • 132
  • 168
Alex Milde
  • 511
  • 1
  • 7
  • 21

1 Answers1

0

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.

Community
  • 1
  • 1
DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • i tried with 10x600 still memory warning lvl 2. thaught there might be a simple "one line solution". i think i will implement a "tile based solution" – Alex Milde Mar 31 '11 at 12:09