当前位置:编程学习 > C/C++ >>

presentModalViewController 的动画效果

系统自带(四种效果):
presentModalViewController模态的动画效果设置:
    
[cpp]  
UIViewController *detailViewController = [[UIViewController alloc] init];  
detailViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;    // 设置动画效果  
[self presentModalViewController:detailViewController animated:YES];  
[detailViewController release];  
 
    共有以下四种动画效果:
    
[cpp]  
typedef enum {  
     UIModalTransitionStyleCoverVertical = 0,  
     UIModalTransitionStyleFlipHorizontal,  
     UIModalTransitionStyleCrossDissolve,  
  
  
     #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2  
     UIModalTransitionStylePartialCurl,  
     #endif  
 } UIModalTransitionStyle;  
 
自定义:
[cpp]  www.zzzyk.com
<span style="color:#330033;">CATransition *animation = [CATransition animation];  
[animation setDuration:0.5];  
[animation setType:kCATransitionPush];  
[animation setSubtype:kCATransitionFromRight];  
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];  
[[myViewController.view layer] addAnimation:animation forKey:@"SwitchToView"];    
  
  
[self presentModalViewController:myViewController animated:NO];</span>  
 
补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,