Reputation: 99
Im trying to make a scroll on my app which halfway works. When I rum the program, my scroll scrolls but not all the way down. It just stops and I don't know how to adjust it. The scroll view is the same size as the view, but the view on top of the scroll is bigger. I tried some code that I found online, but it just keeps saying "expected declaration." Any ideas on how to implement this? This is on swift.
import UIKit
class medicationsViewController: UIViewController {
@IBOutlet var scroll: UIScrollView!
@IBOutlet weak var scroller: UIScrollView!
scroll.userInteractionEnabled = true
scroll.contentSize = CGSizeMake(320,1100)
}
Upvotes: 0
Views: 69
Reputation: 61
Try to put the scroll changes inside of some method. Example:
override func viewDidLoad() {
super.viewDidLoad()
scroll.userInteractionEnabled = true
scroll.contentSize = CGSizeMake(320,1100)
}
Upvotes: 1