开发者

UIView setAnimationTransition is not working?

开发者 https://www.devze.com 2023-01-14 12:17 出处:网络
i have added one view in UIwindowas [window addSubview:parVC.view]; i toggle the parVC.view through the following , but it is not working

i have added one view in UIwindow as [window addSubview:parVC.view];

i toggle the parVC.view through the following , but it is not working

- (IBAction)flipToback:(id)sender
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAn开发者_StackOverflow中文版imationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft 
                           forView:parVC.view 
                             cache:YES];
    [parVC.view addSubview:imgController.view];
    [UIView commitAnimations];
}

I have set correctly imgController.view in IB in app delegate. I want to avoid window in forView. If i give window instead of forView:parVC.view , it works fine....


That sounds like the correct behavior to me. setAnimationTransition:forView:cache: operates on the container view, not the one you're adding.

0

精彩评论

暂无评论...
验证码 换一张
取 消