i've got an UIImageView, now i want to repeat this image, that it always shows up again when scrolling left or right.
Little Example:
is this possible? it should feel like an infinite loop
i've got an UIImageView, now i want to repeat this image, that it always shows up again when scrolling left or right.
Little Example:
is this possible? it should feel like an infinite loop
If you don't care about performance, you can use a "pattern image":
I think it just draws it to the view's context, though, which means it can't be "infinite" and performance might be a bit slow.
The word "infinite" rules out a
UISCrollView
or aCATiledLayer
, obviously.I'd say the easiest way to achieve this is to initialize enough
UIImageView
s to completely fill your screen (or scroll area), plus one, and implement your own dragging/scrolling system and recycle theUIImageView
s as they go off one side of the screen to reappear on the other side. Because all theUIImageView
s are the same image you shouldn't ever have to worry about memory/cache management.