我正在使用presentViewController来呈现新的屏幕
let dashboardWorkout = DashboardWorkoutViewController()
presentViewController(dashboardWorkout, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
这从底部到顶部呈现新屏幕,但我希望它从右到左呈现而不使用UINavigationController.
我使用Xib而不是故事板,所以我该怎么做?
我有一些想要在iOS程序中滑动的视图.现在,我正在使用模态样式在它们之间滑动,并使用交叉溶解动画.但是,我希望有一个像你在主屏幕上看到的滑动/滑动动画等.我不知道如何编写这样的转换,并且动画样式不是可用的模态转换样式.谁能给我一个代码示例?它不需要是模态模型或任何东西,我只是发现最简单.
我的应用程序有一个导航控制器,我不想要任何动画:
通过pushViewController:animated:方法,在推送视图时阻止动画很容易
但是当我点击这个子视图中的"后退"按钮时,会有一个动画!KO!我该怎么做才能阻止这个动画?
如果我只是调用push方法:
[self.navigationController pushViewController:viewController animated:YES];
Run Code Online (Sandbox Code Playgroud)
然后它使用推动画.如何更改它以使用交叉溶解动画,就像我可以使用模态segue?
我想使用Swift推动一个视图控制器并为其设置动画,使其从底部显示并向上移动.我有以下代码来推动我的视图控制器:
let helloTableViewController = self.storyboard!.instantiateViewControllerWithIdentifier("helloTableViewController") as! HelloTableViewController
self.navigationController!.pushViewController(helloTableViewController, animated: true)
Run Code Online (Sandbox Code Playgroud)
我从另一个问题中找到了以下内容,但似乎无法在Swift中使用它:
CATransition *animation = [CATransition animation];
[animation setDuration:2];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
SecondView *sObj=[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
[self.navigationController pushViewController:sObj animated:YES];
[[sObj.view layer] addAnimation:animation forKey:@"SwitchToView1"];
Run Code Online (Sandbox Code Playgroud) 我是Iphone SDK的新手.我正在使用以下代码.但是当我点击这个按钮时,动画从右到左发生.我想要从botton到Up
- (IBAction)clickedsButton:(id)sender
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController:settingsController animated:TRUE];
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)
setAnimationTransition只支持两个... 1)UIViewAnimationTransitionFlipFromLeft 2)UIViewAnimationTransitionFlipFromRight ..有什么帮助吗?我使用了以下,但它不起作用
settingsController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.navigationController pushViewController:settingsController animated:YES];
Run Code Online (Sandbox Code Playgroud) 我正在使用以下语句推送我的视图控制器:
[[self navigationController] pushViewController:self.customViewController animatedWithTransition:UIViewAnimationTransitionFlipFromLeft];
Run Code Online (Sandbox Code Playgroud)
现在当我按下后退按钮时,我想用uiviewanimationtransitionflipfromright来设置动画.
喜欢
[self.navigationController popViewControllerAnimatedWithTransition:UIViewAnimationTransitionFlipFromLeft];
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做?
谢谢
我正在使用导航控制器并推送segues来控制我的应用程序的流量.无论如何都要改变推送segues的从右到左的默认动画?有什么东西我可以覆盖某个地方吗?
谢谢
我有两个UIViewControllers.我的第一个UIViewController显示各种视频缩略图,照片和笔记.并且第二个控制器可用于在先前的控制器中显示所选的视频,照片或音符.我在我的第一个控制器中也有一个UICollectionView,它列出了iOS中Apple的Photo App.
我使用"pushviewcontroller"来显示我的第二个视图控制器.
UIStoryboard *sb=[UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
FirstDetailViewController *fD=[sb instantiateViewControllerWithIdentifier:@"firstDetail"];
[self.navigationController pushViewController: seconVCObj animated: YES];
Run Code Online (Sandbox Code Playgroud)
但我想用ios照片应用程序等缩放效果打开它.当您触摸照片时,应用会将照片显示为缩放.
ios ×6
iphone ×3
swift ×3
animation ×2
back-button ×1
catransition ×1
cocoa-touch ×1
object ×1
objective-c ×1
segue ×1
swift2 ×1
swipe ×1
transition ×1
xcode ×1