문제

Background: I am trying to create an app which looks a little like Yahoo Weather App. In that app, you may add more than 1 locations. You can swipe left and right to get to a new location. While you are swiping there is a clear black separator between the two location views (more than 1 pixel thick).

Problem: I can only create a separator which also appears as a black boarder around my stationary view, if I were to get a separator. Otherwise, The views are connected without and indicator.

Question: How do I make separator, without adding boarder to my view controllers.(ie padding between viewcontrollers)

Current enter image description here

Want enter image description here

도움이 되었습니까?

해결책

In your page view controller's container:

NSDictionary* options = @{ UIPageViewControllerOptionInterPageSpacingKey : [NSNumber numberWithFloat:2.0f] };

self.pageViewController = [[UIPageViewController alloc] 
                            initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll 
                            navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal 
                            options:options];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top