我通过Storyboard向superview添加了一个视图(displayTapeView),它运行正常。但是当我想在displayTapeView上单击" Back"按钮时删除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并显示超级视图。
提前谢谢!
答案 0 :(得分:0)
self.displayTapeView.hidden = YES;