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.

12334 questions
1733
votes
95 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…
philfreo
  • 36,787
  • 25
  • 119
  • 140
558
votes
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…
Wirsing
  • 6,104
  • 3
  • 13
  • 13
314
votes
29 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?
nico
  • 9,358
  • 8
  • 23
  • 28
241
votes
19 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?
itsaboutcode
  • 21,936
  • 42
  • 103
  • 153
229
votes
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
  • 54,283
  • 54
  • 221
  • 287
225
votes
8 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 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…
qwertz
  • 5,684
  • 9
  • 35
  • 60
188
votes
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…
Alex1987
  • 8,819
  • 14
  • 66
  • 90
177
votes
15 answers

Get UIScrollView to scroll to the top

How do I make a UIScrollView scroll to the top?
Jack Humphries
  • 12,423
  • 14
  • 77
  • 119
177
votes
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…
user1459524
  • 3,593
  • 4
  • 16
  • 28
165
votes
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…
climbon
  • 2,133
  • 4
  • 16
  • 17
164
votes
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?
ForeignerBR
  • 2,339
  • 4
  • 22
  • 27
152
votes
19 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
  • 6,912
  • 8
  • 44
  • 47
152
votes
12 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 …
Adrian
  • 16,820
  • 32
  • 99
  • 188
144
votes
26 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…
hpique
  • 112,774
  • 126
  • 328
  • 461
134
votes
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?
Thanks
  • 39,247
  • 69
  • 202
  • 315
1
2 3
99 100