2014-07-10 1 views
2

이미 몇 가지보기가있는 페이지 기반 응용 프로그램을 만들었습니다. RootViewController는 앱 레이아웃을 설정하는 책임이 있으며보기 크기를 제외하고는 모든 것을 잘 수행합니다.스토리 보드에서보기가 올바르게 표시되지 않습니다.

여기에 다른 I 설정의 모든 스토리 보드를 사용하도록 컨트롤러에서 다른 모든 코드가 작동하지 측면을 처리 내가

// Configure the page view controller and add it as a child view controller 
    self.pageViewController = UIPageViewController(
     transitionStyle: .Scroll, 
     navigationOrientation: .Horizontal, 
     options: nil 
    ); 

    self.pageViewController.delegate = self; 

    // Setup the initial page 
    let startingViewController = self.modelController.viewControllerWithProfileProvider(
     self.profileProviderPreference(), 
     storyboard: self.storyboard 
    ); 

    self.pageViewController.setViewControllers(
     [startingViewController as BrowsingViewControllerBase] as [AnyObject], 
     direction: UIPageViewControllerNavigationDirection.Forward, 
     animated: false, 
     completion: { done in } 
    ); 

    self.pageViewController.dataSource = self.modelController; 
    self.addChildViewController(self.pageViewController); 
    self.view.addSubview(pageViewController.view); 

    // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages 
    self.pageViewController.view.frame = self.view.bounds; 

    // Notify the page view controller that we just moved to it. This is a framework imposition. See the docs. 
    self.pageViewController.didMoveToParentViewController(self); 

    // Add the page view controller's gesture recognizers to the view controller's view so that the gestures are started more easily. 
    self.view.gestureRecognizers = self.pageViewController.gestureRecognizers; 

을 가지고있는 부분입니다. viewControllerWithProfileProvider: 메서드는 화면에 표시되지만 올바르게 표시되지 않는 적절한보기를 반환합니다. 여기에 내가 스토리 보드에있는 내용은 다음과 같습니다

enter image description here

는 그때 주어진 공급자 (. 즉, 페이스 북, 트위터, 링크드 인 ...)에 따라 버튼의 색상과 라벨을 변경합니다. 하지만이 얻을 : 버튼이 화면 밖으로 얼마나

enter image description here

공지 사항. 나는 이것을 위해 키 라인이 self.pageViewController.view.frame = self.view.bounds;이라고 생각 하겠지만, 무엇을 사용해야할지 모르겠습니다. 보기가 올바르게 표시되게하려면 어떻게해야합니까?

+1

iPad 스토리 보드의 스크린 샷처럼 보입니다. 자동 크기 조정 기능이 없으면 iPhone의 iPad 스토리 보드 인 – LyricalPanda

+1

을 사용하는 경우 꺼져있을 것입니다. WWDC14에서 크기 클래스에 대한 동영상을보십시오. – dasdom

+0

@LyricalPanda, 어떻게 바꿀 수 있습니까? 나는 iPhone 용 프로젝트를 만들었습니다 ... –

답변

0

컨트롤 상자를 클릭하고 위쪽으로 드래그하여 팝업에서 위쪽 공간을 선택하십시오. 오른쪽과 왼쪽 모두 동일한 작업을 수행하고 선행 공백과 후행 공백을 각각 선택하십시오. 이 앱이 잘 작동하면 도움이됩니다.

0

당신이 사용해야 할 것 같은데, 나는 똑같은 고통을 겪었습니다. 그러나 Autolayout 나를 구해주세요.

관련 문제