I have a simple iOS NavigationController
based application. Two UICollectionViews
, one after another. If element on "first collection" was clicked, the "second collection" will be opened.
Quite simple.
Important note:
"Both UICollectionViews
have transparent background. General background color for navigationController
is used. (Inherited class from UINavigationController
)"
The problem:
If understood it right, push method of NavigationController
works according to algorithm:
- Pushing view is created.
- Transparent gray overlay is created over pushing view.
- NavigationController pushes the view with standard animation. (Gray overlay still there)
- Gray overlay disappears.
(If pushing view has transparent background, a gray vertical line is visible)
Next step: I've tried to solve this problem by overriding push method. Here's what I've got:
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
CATransition *transition = [CATransition animation];
transition.duration = 0.45;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
transition.fillMode = kCAFillModeForwards;
transition.delegate = self;
[self.view.layer addAnimation:transition forKey:nil];
[super pushViewController:viewController animated:animated];
}
This way creates its own push animation, but there were another standard animations used, which I can't remove. (Blackout on presenting and hiding views)
Question: "How can I push ViewController, without fading, blackout, and other animation filters?"
Solutions with theme names (on stackoverflow.com)
- iOS 7
UINavigationController
Push animation shadow - iOS 7 shows black background in custom animation for Navigation
Don't work.