[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:whiteBackdrop cache:YES];
这个属性可以设置动化的旋转方向
代码如下:
- (void) animationFinished: (id) sender { self.navigationItem.rightBarButtonItem =[[[UIBarButtonItem alloc] initWithTitle:@"11" style:UIBarButtonItemStylePlain target:self action:@selector(flip:)] autorelease]; }
{ // 隐藏右侧按钮 self.navigationItem.rightBarButtonItem = nil;
[UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1.0];
UIView *whiteBackdrop = [self.view viewWithTag:100];
if ([(UISegmentedControl *)self.navigationItem.titleView selectedSegmentIndex]) [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:whiteBackdrop cache:YES]; else [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight forView:whiteBackdrop cache:YES];
NSInteger maroon = [[whiteBackdrop subviews] indexOfObject:[whiteBackdrop viewWithTag:998]]; [whiteBackdrop exchangeSubviewAtIndex:purple withSubviewAtIndex:maroon];
[UIView setAnimationDidStopSelector:@selector(animationFinished:)]; [UIView commitAnimations]; }
{ self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]; self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"11" style:UIBarButtonItemStylePlain target:self action:@selector(flip:)] autorelease]; //BARBUTTON(@"Flip",);
// 设置分段控件 标题 UISegmentedControl *seg = [[[UISegmentedControl alloc] initWithItems:[@"左转 右转" componentsSeparatedByString:@" "]] autorelease]; seg.selectedSegmentIndex = 0; seg.segmentedControlStyle = UISegmentedControlStyleBar; self.navigationItem.titleView = seg;
UIView *view100=[[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320, 480)]; view100.tag=100; view100.backgroundColor=[UIColor blueColor];
|