在App中实现iPhone主屏那样手指滑动翻页效果的代
2010-05-31 14:32
911 查看
以下这段“youke”分享的代码,能让您的App实现类似iPhone主屏幕那样的手指划动翻页效果,注意将代码中的“coming“和”going”换成想要的项。
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewController *coming = [[UIViewController alloc] init];
UIViewController *going = [[UIViewController alloc] init];
UIViewAnimationTransition transition;
coming.view = self.view.superview;
going.view = self.view;
transition = UIViewAnimationTransitionCurlUp;
//[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView setAnimationTransition:transition forView:self.view.superview cache:YES];
[coming viewWillAppear:YES];
[going viewWillDisappear:YES];
[going.view removeFromSuperview];
[going viewDidDisappear:YES];
[coming viewDidAppear:YES];
[UIView commitAnimations];
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewController *coming = [[UIViewController alloc] init];
UIViewController *going = [[UIViewController alloc] init];
UIViewAnimationTransition transition;
coming.view = self.view.superview;
going.view = self.view;
transition = UIViewAnimationTransitionCurlUp;
//[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView setAnimationTransition:transition forView:self.view.superview cache:YES];
[coming viewWillAppear:YES];
[going viewWillDisappear:YES];
[going.view removeFromSuperview];
[going viewDidDisappear:YES];
[coming viewDidAppear:YES];
[UIView commitAnimations];
相关文章推荐
- 在App中实现iPhone主屏那样手指滑动翻页效果的代
- js实现移动端手指左右上下滑动翻页效果
- Android实现阅读APP平移翻页效果
- iPhone ebook 中翻页效果(牛人)的实现
- Android App中ListView仿QQ实现滑动删除效果的要点解析
- 使用jQueryMobile实现滑动翻页效果的方法
- swiper实现臭美app滑动效果
- Android App中使用ViewPager+Fragment实现滑动切换效果
- 将一个view 的背景设为透明 但view上的图标 不透明 实现类似iphone ipad 主页的滑动效果
- 实现一个随手指移动而滑动的效果---爬坑
- android ViewPager实现滑动翻页效果实例代码
- android dialog实现底部弹出和手指滑动隐藏效果
- Android ViewPager实现左右滑动翻页效果
- Android自定义ViewPager实现纵向滑动翻页效果
- android开发之&使用ViewPager加gridView实现菜单按钮分页滑动(类似QQ表情选择翻页效果)
- Android Gallery实现滑动翻页效果
- iphone手机桌面滑动效果使用css3实现
- 移动端手指滑动实现轮播效果
- 在Android app中实现九(n)宫格图片连续滑动效果
- 桌面浏览器实现滑动翻页效果(Swiper)