Objective c 在子UIView don´中翻转动画;找不到

Objective c 在子UIView don´中翻转动画;找不到,objective-c,ios5,uiview,flip,modal-view,Objective C,Ios5,Uiview,Flip,Modal View,我想在我的子视图中翻转运动。 在下一个方法中,更改我的子视图,但不更改翻转动画 int tag=g.view.tag; UIViewController* vc2 = [controlersOfTableBoxes objectAtIndex:tag-1]; UIView* viewOfSelf = self.view; UIViewController* v = [[UIViewController alloc] init]; [UIView beg

我想在我的子视图中翻转运动。 在下一个方法中,更改我的子视图,但不更改翻转动画

    int tag=g.view.tag;
    UIViewController* vc2 = [controlersOfTableBoxes objectAtIndex:tag-1];

    UIView* viewOfSelf = self.view;
    UIViewController* v = [[UIViewController alloc] init];

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:v.view cache:NO];

    int maxGraphs = [[viewOfSelf subviews] count];

    for (int i = 0; i < maxGraphs; i++ ) 
    {
        if([[[viewOfSelf subviews] objectAtIndex:i]  isKindOfClass:[UIView class]])
        {
            UIView* v = [[viewOfSelf subviews] objectAtIndex:i];
            if(v.tag==tag)
            {
                 [[[viewOfSelf subviews] objectAtIndex:i] removeFromSuperview];
               break;   
            }
        }
    }
    [viewOfSelf addSubview:vc2.view];
    v.view = viewOfSelf;

    [UIView commitAnimations];
为了

移动在整个屏幕中,但我只想在subviewcontroller中的subview中

我尝试使用这种方法:

 [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationTransitionFlipFromRight animations:^(void) 
     { 
         int tag=g.view.tag;
         UIViewController* vc2 = [controlersOfTableBoxes objectAtIndex:tag-1];

         UIView* viewOfSelf = self.view;
         UIViewController* v = [[UIViewController alloc] init];
         int maxGraphs = [[viewOfSelf subviews] count];

         for (int i = 0; i < maxGraphs; i++ ) 
         {
             if([[[viewOfSelf subviews] objectAtIndex:i]  isKindOfClass:[UIView class]])
             {
                 UIView* view = [[viewOfSelf subviews] objectAtIndex:i];
                 if(view.tag==tag)
                 {
                     v.view=view;
                     [[[viewOfSelf subviews] objectAtIndex:i] removeFromSuperview];
                     break;   
                 }
             }
         }
         [viewOfSelf addSubview:vc2.view];
         v.view = viewOfSelf;
     } 
     completion:^(BOOL finished) 
     {}];
[UIView animateWithDuration:0.5f延迟:0.0f选项:UIViewAnimationTransitionFlipFromRight动画:^(无效)
{ 
int tag=g.view.tag;
UIViewController*vc2=[ControllerSoftableBox对象索引:tag-1];
UIView*viewOfSelf=self.view;
UIViewController*v=[[UIViewController alloc]init];
int maxGraphs=[[viewOfSelf子视图]计数];
对于(int i=0;i
但是结果是一样的…

您可以使用

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5];
[UIView transitionFromView:view2 toView:view1 duration:3 options:UIViewAnimationOptionTransitionFlipFromBottom completion:NULL];
[UIView commitAnimations];
试一试 我


这个解决方案和我的一样。。。除非移动所有屏幕,否则不能仅移动子视图您正在使用UIViewAnimationTransitionFlipFromRight而不是UIViewAnimationOptionTransitionFlipFromRight相同使用UIViewAnimationTransitionFlipFromRight或UIViewAnimationOptionTransitionFlipFromRight或UIViewAnimationOptionTransitionFlipFromBottom。。。结果是相同的唯一更改类型的动画。请尝试以下回答[UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationCurveLinear动画:^(void){//将其移动到您想要的任何位置。thisPersonViewController.view.frame=CGRectMake(0.0f,0.0f,thisPersonViewController.view.frame.size.width,thisPersonViewController.view.frame.size.height);}完成:^(BOOL finished){//如果需要,在完成动画时执行某些操作。}];这适用于同一视图上的子视图,而不是两个不同视图之间的子视图
 [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationTransitionFlipFromRight animations:^(void) 
     { 
         int tag=g.view.tag;
         UIViewController* vc2 = [controlersOfTableBoxes objectAtIndex:tag-1];

         UIView* viewOfSelf = self.view;
         UIViewController* v = [[UIViewController alloc] init];
         int maxGraphs = [[viewOfSelf subviews] count];

         for (int i = 0; i < maxGraphs; i++ ) 
         {
             if([[[viewOfSelf subviews] objectAtIndex:i]  isKindOfClass:[UIView class]])
             {
                 UIView* view = [[viewOfSelf subviews] objectAtIndex:i];
                 if(view.tag==tag)
                 {
                     v.view=view;
                     [[[viewOfSelf subviews] objectAtIndex:i] removeFromSuperview];
                     break;   
                 }
             }
         }
         [viewOfSelf addSubview:vc2.view];
         v.view = viewOfSelf;
     } 
     completion:^(BOOL finished) 
     {}];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5];
[UIView transitionFromView:view2 toView:view1 duration:3 options:UIViewAnimationOptionTransitionFlipFromBottom completion:NULL];
[UIView commitAnimations];
nt tag=g.view.tag;
 UIViewController* v = [controlersOfBoxes objectAtIndex:tag-1];
 UIViewController* vc2 = [controlersOfTableBoxes objectAtIndex:tag-1];
 [UIView transitionWithView:vc2.view duration:0.5 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^ { [v.view removeFromSuperview]; [self.view addSubview:vc2.view]; } completion:nil];