1

I have created a scrollable UIViewController with an UIScrollView with storyboard. On this screen are two UITextView, one MKMapView, two UIDatePicker and a UIButton at the bottom.

I designed it like it's descripted in How to use UIScrollView in Storyboard. In my code I added the following lines in my viewDidLoad():

    scrollView.pagingEnabled = true
    scrollView.addSubview(textView)
    scrollView.addSubview(map)
    scrollView.addSubview(starttime)
    scrollView.addSubview(endtime)
    scrollView.contentSize = CGSizeMake(375, 1000)
    scrollView.frame = CGRect(x: 0,y: 0,width: 375,height: 667)

The screen is really scollable, but if I want to set a date with the two datepickers or I want to click the button at the bottom of the screen, the focus jumps always to the top of the screen. I always can handle the elements on the screen which are displayed on the start screen. Every element which is always reachable by scrolling is not usable. So, I can not use all elements on the UIScrollView. How is it possible to solve this problem?

Community
  • 1
  • 1
Karl
  • 1,601
  • 3
  • 15
  • 13

0 Answers0