0

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)

}

1 Answer 1

1

Try to put the scroll changes inside of some method. Example:

override func viewDidLoad() {
 super.viewDidLoad()
 scroll.userInteractionEnabled = true
 scroll.contentSize = CGSizeMake(320,1100) 
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.