I want to make a menu with a wide image that scrolls horizontally (it's a continuous image). What technique could I use for this? Thanks!
Asked
Active
Viewed 149 times
1 Answers
1
The standard way to do this is to create a NSScrollView
and nest a NSImage
in it. You could run into problems if your continuous image is too large, however. In that case you'd want to split it into multiple NSImage
s and arrange them next to each other in the NSScrollView
.

Idles
- 1,131
- 5
- 9
-
Okay thanks! What's too large, you think? And how do I animate the scrolling? – Fatso Jun 19 '13 at 18:25
-
Oh, do you want the image to scroll by itself and ignore user input? In that case, you can get rid of the `UIScrollView` and instead use `UIAnimation` to adjust the position of the `UIImageView` (or `UIImageviews`) over time. Many older iOS devices won't allow an image larger than 1024 pixels in width or height; newer devices have limits of 2048 pixels. – Idles Jun 19 '13 at 18:27
-
Oh yes and I'm on osx not on iOS! I'll edit the tags, sorry! But what you say must be somewhat similar to the solution on osx, no? – Fatso Jun 19 '13 at 18:35
-
Yes, you'll probably just need to replace all occurrences of `UI` with `NS` :) And it's likely that you won't have any trouble with larger images. – Idles Jun 19 '13 at 18:39
-
Okay I'll document myself and answer my own question when I find a solution, thanks for pointing me in the right direction! – Fatso Jun 19 '13 at 18:50