简体   繁体   中英

How to use UIScrollview with paging enabled and the touch events of following and previous images

I'm creating an iPad Application where I have created a UIScrollview which has paging enabled. I have number of images and each images are subviews of the view and view is a subview of scrollview. There are multiple view.Views are of different sizes. I'm able to get the touch event of the image which is at the centre of scrollview. But I also want to get touch events of following and previous image within the scrollview.

Is it possible to do same thing without enabling paging.Because if paging is disabled then i can get touch events easily. But I want same paging effect

Thanks

Dont use UIImageViews if you want touch events to be registered. Use UIButtons and set the images for each button. You can customise the button be extending it or use the hit states to control the images displayed on touch.

check contentSize of your scrollView. Maybe the width is not enough for 3 images.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM