0
Я хочу движение с переворотом в моем подзоне. В следующем методе изменить свой подвид, но без покадровой анимации ....Флип-анимация в суб-UIView не найден
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];
Если я изменить эти строки:
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:v.view cache:NO];
для
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO];
движение всего экрана но я хочу только в subview в subviewcontroller.
Я стараюсь этого метода:
[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)
{}];
, но результат тот же ...
Это решение такое же, как мое .. . Не двигаться только подвид, если движение все экран – Davidin073
вы используете UIViewAnimationTransitionFlipFromRight не UIViewAnimationOptionTransitionFlipFromRight –
такое же использование UIViewAnimationTransitionFlipFromRight или UIViewAnimationOptionTransitionFlipFromRight или UIViewAnimationOptionTransitionFlipFromBottom ... результат тот же только изменение типа анимации. – Davidin073