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
48
votes
4 answers

How can I change the page on clicking the dots of UIPageControl

Here I have a pagecontrol which works good but on clicking on dot it doesn't change the page so please help in the function of changepage: - (void)viewDidLoad { scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 420)]; …
Vivek Sehrawat
  • 6,560
  • 2
  • 26
  • 39
47
votes
14 answers

UIScrollView not scrolling in Swift

My UIScrollView won't scroll down. I don't know why. I already followed Apple documentation regarding to this issue. @IBOutlet weak var scroller: UIScrollView! override func viewDidLoad() { super.viewDidLoad() // Do any additional…
Nurdin
  • 23,382
  • 43
  • 130
  • 308
47
votes
9 answers

ScrollView gesture recognizer eating all touch events

I have a UIScrollView to which I added a single tap gesture recognizer to show/hide some UI overlay using: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; [scrollView…
Itai Hanski
  • 8,540
  • 5
  • 45
  • 65
46
votes
9 answers

Problem with uiscrollview setcontentoffset animated not scrolling when animated:yes is set

This is very odd and I'm wondering if anyone has any thoughts? I'm trying to scroll a UIScrollView in response to a button press on the iPad. If I do: CGPoint currentOff = scrollView.contentOffset; currentOff.x+=240; [scrollView…
BountyBob
  • 468
  • 1
  • 4
  • 8
46
votes
11 answers

Programmatically scroll a UIScrollView to the top of a child UIView (subview) in Swift

I have a few screens worth of content within my UIScrollView which only scrolls vertically. I want to programmatically scroll to a view contained somewhere in it's hierarchy. The UIScrollView move so that the child view is at the top of the…
dyson returns
  • 3,376
  • 4
  • 16
  • 20
46
votes
5 answers

ScrollView not scrolling when dragging on buttons

I have a scroll view that used to scroll when it didn't have buttons all over it. Now it does, and when dragging the mouse (on simulator) nothing happens (i think because the buttons are being pushed). How can I make this right?
DanielaM
  • 591
  • 1
  • 5
  • 6
46
votes
5 answers

How to create a Scroll View with a page control using swift?

I am trying to create a Page View controller with numbers of view. I want a simple code sample that will use UIPageViewController.
LC 웃
  • 18,888
  • 9
  • 57
  • 72
45
votes
11 answers

UIScrollView custom paging size

paging in UIScrollView is a great feature, what I need here is to set the paging to a smaller distance, for example I want my UIScrollView to page less size that the UIScrollView frame width. Thanks
user784625
  • 1,928
  • 5
  • 24
  • 38
45
votes
4 answers

Intercepting pan gestures over a UIScrollView breaks scrolling

I have a vertically-scrolling UIScrollView. I want to also handle horizontal pans on it, while allowing the default vertical scroll behavior. I've put a transparent UIView over the scroll view, and added a pan gesture recognizer to it. This way I…
44
votes
14 answers

How to Zoom In/Out Photo on double Tap in the iPhone WWDC 2010 - 104 PhotoScroller

I am going through the Sample code of iPhone WWDC 2010 - 104 PhotoScroller App. It's working great with my project related images (PDF Page Images) but I am struggling detect touches in the PhotoScroller App. The Zooming using multiple touches is…
Roger_iPhone
  • 737
  • 1
  • 9
  • 20
43
votes
3 answers

iOS Autolayout with UIScrollview: Why does content view of scroll view not fill the scroll view?

The following code (called in viewDidLoad) results in a fully red screen. I would expect it to be a fully green screen. Why is it red? And how can I make it all green? UIScrollView* scrollView = [UIScrollView…
dragosaur
  • 818
  • 1
  • 8
  • 10
42
votes
14 answers

Scrolling with two fingers with a UIScrollView

I have an app where my main view accepts both touchesBegan and touchesMoved, and therefore takes in single finger touches, and drags. I want to implement a UIScrollView, and I have it working, but it overrides the drags, and therefore my…
Craig
  • 16,291
  • 12
  • 43
  • 39
42
votes
8 answers

UIScrollView adjusts contentOffset when contentSize changes

I am adjusting a detail view controller's state, just before it is pushed on a navigationController: [self.detailViewController detailsForObject:someObject]; [self.navigationController pushViewController:self.detailViewController …
Berik
  • 7,816
  • 2
  • 32
  • 40
41
votes
12 answers

Tableview scroll content when keyboard shows

I have a table view with a text field and a textview. I've implemented this code like suggested by this apple sample code…
msalafia
  • 2,703
  • 5
  • 23
  • 34
41
votes
6 answers

Auto layout UIScrollView with subviews with dynamic heights

I'm having troubles with UIScrollView using auto layout constraints. I have the following view hierarchy, with constraints set through IB: - ScrollView (leading, trailing, bottom and top spaces to superview) -- ContainerView (leading, trailing,…
lukasz
  • 3,121
  • 1
  • 21
  • 20