0

我在 FirstViewController 中有这样的代码

{
SecondViewController *objComing=[[SecondViewController alloc] init];
[self.view addSubview:objComing.view];

objComing.view.backgroundColor=[UIColor blueColor];

objComing.view.frame=CGRectMake(0,420, 320, 0);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];

[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
objComing.view.frame=CGRectMake(0,0, 320, 420);

[UIView commitAnimations];
}

SecondViewController 包含关闭/关闭按钮。应该如何查看连接到按钮的 IBAction(包含在 SecoundViewController 中)以解除/删除和隐藏此覆盖层?

4

2 回答 2

1

在关闭/关闭按钮方法中添加以下行以删除 secondviewcontroller 子视图:

[self.view removeFromSuperview];
于 2012-04-22T17:10:39.460 回答
0

[self.view removeFromSuperview];

于 2012-04-22T17:12:11.370 回答