如果你创建一个全新的单页面应用,并将该代码放在一个按钮后面:
子视图会立即添加,没有任何动画。如果您先添加子视图,然后尝试对其进行动画处理... 您将遇到同样的问题。
在添加子视图时或之后如何为其制作翻转动画?
UIView *blah = [[UIView alloc] initWithFrame:CGRectMake(0,0,100,100)];
blah.backgroundColor = [UIColor grayColor];
[UIView transitionWithView:blah duration:1
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^{
[self.view addSubview:blah];
}
completion:^(BOOL finished){
}];
子视图会立即添加,没有任何动画。如果您先添加子视图,然后尝试对其进行动画处理... 您将遇到同样的问题。
UIView *blah = [[UIView alloc] initWithFrame:CGRectMake(0,0,100,100)];
[self.view addSubview:blah];
[UIView transitionWithView:blah duration:1
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^{
blah.backgroundColor = [UIColor grayColor];
}
completion:^(BOOL finished){
}];
在添加子视图时或之后如何为其制作翻转动画?