开发者

Suggestions on how to implement a UI Element to display a long image in iPhone

I want to display a long image on iPhone. The user can swipe left or right to see difficult parts of the image. I want to spite the long image into different parts... for example, a long long image is 1000* 100; I want to display 100*100 for each time. When the image is loaded, it shows from x:0 to x:100. When user swipe right, it becomes x:101, x:200. When the user swipe left, it back to x:0, x:100, when the user continue to swipe right, it show x:201, x:300.

I am thinking how to implement this specified imageView. I have two ideas now. First, make my own imageView, which开发者_StackOverflow super class is UIImageView, and overriding the swipe left, swipe right method. Second, make my own UIView. just implement the user swipe left/right action.

Which way you think is better, or any better ideas on implement this? thz u.


Off the top of my head, I would use a UIScrollView and UIPageControl and hook an IBAction to the UIPageControl's value did change event and when that fires, scroll view by 100 or whatever your desired increment is. You'll need to use a couple of the UIScrollView delegate methods as well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜