我通过 Storyboard 向超级视图添加了一个视图(displayTapeView),它工作正常。但是当我想在单击 displayTapeView 上的“返回”按钮时删除 displayTapeView。它不起作用。我当前的代码如下:
- (IBAction)tapeButtonPressed:(id)sender {
self.displayTapeView.hidden=NO;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
//[[self displayTapeView] removeFromSuperview];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.displayTapeView cache:YES];
self.displayTapeView.layer.masksToBounds=NO;
self.displayTapeView.layer.shadowOffset=CGSizeMake(-15.0,20.0);
self.displayTapeView.layer.shadowRadius=5.0;
self.displayTapeView.layer.shadowOpacity=0.5;
//[[self view] addSubview:_displayTapeView];
[UIView commitAnimations];
}
- (IBAction)backButtonPressed:(id)sender {
[[self displayTapeView] removeFromSuperview];
}
我想要做的是当单击“返回”按钮时,displayTapeView 被删除并显示超级视图。
先感谢您!