Questions tagged [uiscrollview]

Use this tag for all questions about scroll views on iOS. Do NOT use this tag for other platforms.

UIScrollView is the native scroll view system in iOS. It is part of Cocoa and UIKit. A number of other very common iOS classes, such as UITableView, are based on UIScrollView. UIScrollViewDelegate is the associated delegate.

Full Apple documentation for UIScrollView is at the usual Apple documentation site. It is on the internet. It can be found at https://developer.apple.com/reference/uikit/uiscrollview.

Use this tag only for the specific, iOS, UIScrollView class. For the native scroll views in other specific platforms, such as Android, use those tags.

If you genuinely have a rare, non-platform-specific, general conceptual question about scroll views, you could use the otherwise totally worthless tag.

12500 questions
40
votes
5 answers

iphone - prevent uiscrollview from scrolling by touch

I've a scrollview and on both sides, I've two buttons left and right. when i click the scroll view will move left and when right button is clicked it will move right side. My scrollview has 20 buttons (approx) & on click of each button some action…
Satyam
  • 15,493
  • 31
  • 131
  • 244
40
votes
3 answers

How to steal touches from UIScrollView?

Today on my creative time I did some quite comprehensive research on how to steal touches from a UIScrollView and send them instantly to a specific subview, while maintaining the default behavior for the rest of the scroll view. Consider having a…
Erik B
  • 40,889
  • 25
  • 119
  • 135
40
votes
7 answers

UIScrollView wrong offset with Auto Layout

I have a fairly simple view configuration: A UIViewController, with a child UIScrollView and a UIImageView in this UIScrollView. I set the UIImageView with a height sufficient to break out of the visible area (ie. higher to 1024pt), and set the…
Guillaume Algis
  • 10,705
  • 6
  • 44
  • 72
40
votes
13 answers

How to make a UIScrollView auto scroll when a UITextField becomes a first responder

I've seen posts around here that suggest that UIScrollViews should automatically scroll if a subview UITextField becomes the first responder; however, I can't figure out how to get this to work. What I have is a UIViewController that has a…
Nosrettap
  • 10,940
  • 23
  • 85
  • 140
40
votes
4 answers

Deactivate UIScrollView decelerating

Is there a way to deactivate the decelerating of a UIScrollView? I want to allow the user to scroll the canvas, but I don't want that the canvas continues scrolling after the user lifted the finger.
Markus Müller-Simhofer
  • 3,391
  • 1
  • 28
  • 32
39
votes
8 answers

iPhone UIScrollView Speed Check

I know how to get the contentOffset on movement for a UIScrollView, can someone explain to me how I can get an actual number that represents the current speed of a UIScrollView while it is tracking, or decelerating?
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
39
votes
7 answers

How to create a UIScrollView Programmatically?

Alright, so the key here is I'm not using IB at all, because the View I'm working with is created programmatically. The UIView covers the lower half the screen, and has a bunch of buttons on it. However, I want to add more buttons to the UIView,…
Ethan Mick
  • 9,517
  • 14
  • 58
  • 74
39
votes
6 answers

Overriding delegate property of UIScrollView in Swift (like UICollectionView does)

UIScrollView has a delegate property which conforms to UIScrollViewDelegate protocol UIScrollViewDelegate : NSObjectProtocol { //... } class UIScrollView : UIView, NSCoding { unowned(unsafe) var delegate: UIScrollViewDelegate? …
stringCode
  • 2,274
  • 1
  • 23
  • 32
39
votes
12 answers

How to set content size of UIScrollView dynamically

I got question about UIScrollview. The story is I have a UIView named ChartsView which I re-draw it myself by override method drawRect(). The content of drawing was generated dynamically. So I do not know its size until runtime. The question is…
Roger Lee
  • 471
  • 1
  • 5
  • 6
38
votes
11 answers

UIScrollView with centered UIImageView, like Photos app

I would like to have scroll view with an image content view. The image is actually map which is much bigger than the screen. The map should be initially in the center of the scroll view, like photos in Photos app when you turn iPhone to landscape…
Martin Ludvik
  • 391
  • 1
  • 4
  • 5
38
votes
6 answers

UILabel updating stops during scrolling UIScrollView

I have a scrollView with an imageView inside of it. The scrollView is a subView of the superView, and the imageView is a subView of the scrollView. I also have a label (at the super-view level) that receives updated values on its text property from…
brainondev
  • 1,117
  • 1
  • 11
  • 20
38
votes
6 answers

UIScrollView Zoom Does Not Work With Autolayout

Zooming with UIScrollView using a strictly autolayout environment does not seem to work. This is especially frustrating because the iOS 6 release notes certainly lead me to believe it should when the wrote about a "Pure Auto Layout approach" here…
Corey
  • 590
  • 1
  • 5
  • 15
37
votes
12 answers

React Native ScrollView is not scrolling to the bottom sometimes

inside my application index.io.js there is only 1 ScrollView that is wrapped inside a View under the render function. Sometimes I can scroll to the very bottom of the ScrollView and keep the screen there. However the ScrollView would bounce back to…
Shih-Min Lee
  • 9,350
  • 7
  • 37
  • 67
37
votes
3 answers

Learning the basics of UIScrollView

I've been having a very hard time finding good examples of UIScrollView. Even Apple's UIScrollView Suite I find a bit lacking. I'm looking for a tutorial or example set that shows me how to create something similar to the iPhone Safari tab…
M. Ryan
  • 6,973
  • 11
  • 52
  • 76
36
votes
1 answer

Horizontal UIScrollView inside a UITableViewCell

I'm trying to create the exact same effect as in the AppStore app for viewing screenshots: inside a UITableView, I have custom subclasses of UITableViewCell's. One of them is designed to show previews of some product, say 4 images. I want them to…
Cyrille
  • 25,014
  • 12
  • 67
  • 90