2017-09-16 13 views
0

나는 scrollview에 대한 여러보기가있는 프로젝트에서 작업하고 있습니다. 가로로 스크롤 할 수 있습니다. 그것은 잘 작동합니다! 하지만 스크롤바에 추가 한 각보기의 탐색 표시 줄에 문제가 있습니다. enter image description here 스크린 샷에서 볼 수 있듯이 화면에 표시되어 있지만 위쪽의 탐색 표시 줄이 위로부터 채우지 않습니다. 이 공백이 있습니다. 원하지 않습니다. 이 공간은 탐색 표시 줄과 동일한 파란색으로 표시하고 싶습니다.Scrollview bartint의 탐색 모음이 위에 없음

내 질문에, 어떻게 이것을 할 수 있습니까?

는 내가있는 ScrollView에 코드를 다음과 같이 의견을 추가 :

class ScrollViewController: UIViewController { 

@IBOutlet weak var scrollView: UIScrollView! 
override func viewDidLoad() { 
    super.viewDidLoad() 

    let profilView = self.storyboard?.instantiateViewController(withIdentifier: "profilController") as! UIViewController 
    self.addChildViewController(profilView) 
    self.scrollView.addSubview(profilView.view) 
    profilView.didMove(toParentViewController: self) 
    profilView.view.frame = scrollView.bounds 

    let testViewTwo = self.storyboard?.instantiateViewController(withIdentifier: "chatController") as! UIViewController 
    self.addChildViewController(testViewTwo) 
    self.scrollView.addSubview(testViewTwo.view) 
    testViewTwo.didMove(toParentViewController: self) 
    testViewTwo.view.frame = scrollView.bounds 

    var frame:CGRect = testViewTwo.view.frame 
    frame.origin.x = self.view.frame.width 
    testViewTwo.view.frame = frame 

    self.scrollView.contentSize = CGSize(width: self.view.frame.width * 2, height: self.view.frame.height) 

    //startposition 
    //self.scrollView.contentOffset = CGPoint(x: (self.view.frame.width) * 1, y: self.view.frame.height) 
} 

감사를 도와!

답변