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

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
99 answers

How can I make a UITextField move up when the keyboard is present - on starting to edit?

With the iOS SDK: I have a UIView with UITextFields that bring up a keyboard. I need it to be able to: Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard is brought up Automatically "jump" (by…
  • 41,941
  • 26
  • 128
  • 141
34 answers

UIScrollView Scrollable Content Size Ambiguity

Fellow devs, I am having trouble with AutoLayout in Interface Builder (Xcode 5 / iOS 7). It's very basic and important so I think everyone should know how this properly works. If this is a bug in Xcode, it is a critical one! So, whenever I have a…
  • 6,713
  • 3
  • 15
  • 13
31 answers

UIScrollView scroll to bottom programmatically

How can I make a UIScrollView scroll to the bottom within my code? Or in a more generic way, to any point of a subview?
  • 9,668
  • 8
  • 26
  • 28
20 answers

Is it possible for UIStackView to scroll?

Let's say I have added more views in UIStackView which can be displayed, how I can make the UIStackView scroll?
  • 24,525
  • 45
  • 110
  • 156
10 answers

How can I mimic the bottom sheet from the Maps app?

Can anyone tell me how I can mimic the bottom sheet in the new Apple Maps app in iOS 10? In Android, you can use a BottomSheet which mimics this behaviour, but I could not find anything like that for iOS. Is that a simple scroll view with a content…
  • 6,206
  • 9
  • 40
  • 62
22 answers

Stop UIWebView from "bouncing" vertically?

Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded? I've looked at the following…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
24 answers

Finding the direction of scrolling in a UIScrollView?

I have a UIScrollView with only horizontal scrolling allowed, and I would like to know which direction (left, right) the user scrolls. What I did was to subclass the UIScrollView and override the touchesMoved method: - (void)touchesMoved:(NSSet…
  • 9,397
  • 14
  • 70
  • 92
13 answers

How to add leading padding to view added inside an UIStackView

This is my setup: I have an UIScrollView with leading,top, trialing edge set to 0. Inside this I add an UIStackView with this constraints: stackView.centerYAnchor.constraintEqualToAnchor(selectedContactsScrollView.centerYAnchor).active = true …
  • 19,440
  • 34
  • 112
  • 219
17 answers

Get UIScrollView to scroll to the top

How do I make a UIScrollView scroll to the top?
Jack Humphries
  • 13,056
  • 14
  • 84
  • 125
10 answers

Programmatically scroll a UIScrollView

I have a UIScrollView which has several views. When a user flicks their finger, the view scrolls to the right or left depending on the direction of the finger flick. Basically my code works in a way similar to the iPhone photo app. Now, is there a…
  • 2,273
  • 4
  • 17
  • 17
18 answers

How can I use Autolayout to set constraints on my UIScrollview?

I have spent two days trying out the various solutions for Mixed and Pure Autolayout approaches to achieve what was a trivial scrollview setup prior to autolayout, and it's now official - I must be too stupid. I am setting this up mostly in…
  • 3,613
  • 4
  • 19
  • 28
22 answers

How to detect when a UIScrollView has finished scrolling

UIScrollViewDelegate has got two delegate methods scrollViewDidScroll: and scrollViewDidEndScrollingAnimation: but neither of these tell you when scrolling has completed. scrollViewDidScroll only notifies you that the scroll view did scroll not that…
Michael Gaylord
  • 7,282
  • 8
  • 50
  • 47
5 answers

What's the UIScrollView contentInset property for?

Can someone explain to me what the contentInset property in a UIScrollView instance is used for? And maybe provide an example?
  • 2,449
  • 4
  • 23
  • 28
27 answers

Center content of UIScrollView when smaller

I have a UIImageView inside a UIScrollView which I use for zooming and scrolling. If the image / content of the scroll view is bigger than the scroll view, everything works fine. However, when the image becomes smaller than the scroll view, it…
  • 119,096
  • 131
  • 338
  • 476
7 answers

Is there a way to hide the scroll indicators in a UIScrollView?

I've got a use case where those indicators disturb the user interaction. Can I subclass and override a method or do something similar to remove the scroll indicators from the scroll view?
  • 40,109
  • 71
  • 208
  • 322
2 3
99 100