晚上好
在 IOS6.0 中,dismissModalViewControllerAnimated:(BOOL) 已弃用。可悲的是,我在互联网上找不到任何其他解决方案。任何人有任何硬仗吗?我有一个带有方法的关闭按钮。在该方法中,模态视图应该关闭。
纽扣制作:
UIButton *closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(200, 200, 50, 50)];
closeBtn.backgroundColor = [UIColor purpleColor];
[closeBtn addTarget:self action:@selector(closeModalView:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:closeBtn];
和方法:
- (void)closeModalView:(id)sender{
//This is deprecated
[self dismissModalViewControllerAnimated:YES];
}
提前谢谢!