2

removeFromSuperview 方法实际上非常快速地拉出图像,有没有办法以动画方式将其删除。谢谢

4

3 回答 3

7

如果您的目标是 iOS4(来自 UIView 文档的代码片段):

[UIView animateWithDuration:0.2
                 animations:^{ table.alpha = 0.0; }
                 completion:^(BOOL finished){ [table removeFromSuperview]; }];
于 2010-08-05T16:11:58.187 回答
0

代码示例在这里

http://www.iphonedevsdk.com/forum/iphone-sdk-development/37467-removefromsuperview-animation-transition.html

于 2010-08-05T16:09:55.770 回答
0

1)将您的新子视图(索引为0,因此它被隐藏)插入视图堆栈。

    [window insertSubview:myNewView atIndex:0];

2)然后动画视图(直接来自文档)是:

[UIView animateWithDuration:0.2
       animations:^{ view.alpha = 0.0; }
       completion:^(BOOL finished){ [view removeFromSuperview]; }]
于 2010-11-12T02:55:06.820 回答