Pergunta

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

Foi útil?

Solução

In your page view controller's container:

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

self.pageViewController = [[UIPageViewController alloc] 
                            initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll 
                            navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal 
                            options:options];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top