diff --git a/tns-core-modules/ui/frame/frame.ios.ts b/tns-core-modules/ui/frame/frame.ios.ts index 54525988b..ae7a1eb5e 100644 --- a/tns-core-modules/ui/frame/frame.ios.ts +++ b/tns-core-modules/ui/frame/frame.ios.ts @@ -77,6 +77,10 @@ export class Frame extends frameCommon.Frame { throw new Error("Required page does not have a viewController created."); } + let clearHistory = backstackEntry.entry.clearHistory; + if (clearHistory) { + navDepth = -1; + } navDepth++; let navigationTransition: definition.NavigationTransition; @@ -117,7 +121,7 @@ export class Frame extends frameCommon.Frame { } // We should clear the entire history. - if (backstackEntry.entry.clearHistory) { + if (clearHistory) { viewController.navigationItem.hidesBackButton = true; var newControllers = NSMutableArray.alloc().initWithCapacity(1); newControllers.addObject(viewController); diff --git a/tns-core-modules/ui/transition/fade-transition.ios.ts b/tns-core-modules/ui/transition/fade-transition.ios.ts index 2a391dccf..4cc463a88 100644 --- a/tns-core-modules/ui/transition/fade-transition.ios.ts +++ b/tns-core-modules/ui/transition/fade-transition.ios.ts @@ -2,6 +2,9 @@ export class FadeTransition extends transition.Transition { public animateIOSTransition(containerView: UIView, fromView: UIView, toView: UIView, operation: UINavigationControllerOperation, completion: (finished: boolean) => void): void { + let originalToViewAlpha = toView.alpha; + let originalFromViewAlpha = fromView.alpha; + toView.alpha = 0.0; fromView.alpha = 1.0; @@ -14,12 +17,16 @@ export class FadeTransition extends transition.Transition { break; } - var duration = this.getDuration(); - var curve = this.getCurve(); + let duration = this.getDuration(); + let curve = this.getCurve(); UIView.animateWithDurationAnimationsCompletion(duration, () => { UIView.setAnimationCurve(curve); toView.alpha = 1.0; fromView.alpha = 0.0; - }, completion); + }, (finished: boolean) => { + toView.alpha = originalToViewAlpha; + fromView.alpha = originalFromViewAlpha; + completion(finished); + }); } } \ No newline at end of file diff --git a/tns-core-modules/ui/transition/slide-transition.ios.ts b/tns-core-modules/ui/transition/slide-transition.ios.ts index 8a58e2516..b337848ad 100644 --- a/tns-core-modules/ui/transition/slide-transition.ios.ts +++ b/tns-core-modules/ui/transition/slide-transition.ios.ts @@ -1,12 +1,12 @@ import transition = require("ui/transition"); import platform = require("platform"); -var screenWidth = platform.screen.mainScreen.widthDIPs; -var screenHeight = platform.screen.mainScreen.heightDIPs; -var leftEdge = CGAffineTransformMakeTranslation(-screenWidth, 0); -var rightEdge = CGAffineTransformMakeTranslation(screenWidth, 0); -var topEdge = CGAffineTransformMakeTranslation(0, -screenHeight); -var bottomEdge = CGAffineTransformMakeTranslation(0, screenHeight); +let screenWidth = platform.screen.mainScreen.widthDIPs; +let screenHeight = platform.screen.mainScreen.heightDIPs; +let leftEdge = CGAffineTransformMakeTranslation(-screenWidth, 0); +let rightEdge = CGAffineTransformMakeTranslation(screenWidth, 0); +let topEdge = CGAffineTransformMakeTranslation(0, -screenHeight); +let bottomEdge = CGAffineTransformMakeTranslation(0, screenHeight); export class SlideTransition extends transition.Transition { private _direction: string; @@ -17,9 +17,12 @@ export class SlideTransition extends transition.Transition { } public animateIOSTransition(containerView: UIView, fromView: UIView, toView: UIView, operation: UINavigationControllerOperation, completion: (finished: boolean) => void): void { - var fromViewEndTransform: CGAffineTransform; - var toViewBeginTransform: CGAffineTransform; - var push = (operation === UINavigationControllerOperation.UINavigationControllerOperationPush); + let originalToViewTransform = toView.transform; + let originalFromViewTransform = fromView.transform; + + let fromViewEndTransform: CGAffineTransform; + let toViewBeginTransform: CGAffineTransform; + let push = (operation === UINavigationControllerOperation.UINavigationControllerOperationPush); switch (this._direction) { case "left": @@ -52,12 +55,16 @@ export class SlideTransition extends transition.Transition { break; } - var duration = this.getDuration(); - var curve = this.getCurve(); + let duration = this.getDuration(); + let curve = this.getCurve(); UIView.animateWithDurationAnimationsCompletion(duration, () => { UIView.setAnimationCurve(curve); toView.transform = CGAffineTransformIdentity; fromView.transform = fromViewEndTransform; - }, completion); + }, (finished: boolean) => { + toView.transform = originalToViewTransform; + fromView.transform = originalFromViewTransform; + completion(finished); + }); } } \ No newline at end of file