iphone翻页效果

来源:互联网 发布:线割编程留暂停点 编辑:程序博客网 时间:2024/05/18 01:05

iphone翻页效果

之前看到的一些翻页效果的代码,解释挺清楚的

[UIView beginAnimations:@"FlipAnim" context:NULL];// 动画开始
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft
forView:[self superview] cache:YES];// 翻转效果
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; // 动画时间曲线
[UIView setAnimationDuration:0.5f];// 动画时间
// 将两个已加入的View切换
[[self superview] exchangeSubViewAtIndex:0 withSubviewAtIndex:1]; [UIView commitAnimations];// 动画结束
可以使用的转换效果如:
UIViewAnimationTransitionFlipFromRight:从右边翻转到左边(右边在上左边在下)
UIViewAnimationTransitionFlipFromLeft:从左边翻转到右边(左边在上右边在下)
UIViewAnimationTransitionCurlUp:往上翻頁(如同Google Map右下角的翻頁按钮)
UIViewAnimationTransitionCurlDown:往下翻頁
UIViewAnimationTransitionNone:无任何效果


原创粉丝点击