我有一个全屏UIImageView的ViewController。我隐藏了statusBar和NavigationBar,所以没有办法返回,只能点击某处。touchesBegan关闭视图
所以我想回去只是用这个的touchesBegan
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self dismissModalViewControllerAnimated:YES];
}
我还试图用这种方式
-(void)viewDidLoad
{
[super viewDidLoad];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self.navigationController setNavigationBarHidden:YES];
UITapGestureRecognizer *tapRecognizer;
tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissModalViewControllerAnimated:)];
[imageFrame addGestureRecognizer:tapRecognizer];
imageFrame.image = [UIImage imageWithContentsOfFile:image];
[tapRecognizer release];
}
我被困在那里,这种全屏幕图像,我可以”不要回头。 我怎样才能关闭viewcontroller?
有什么想法?你没有告诉我们问题是什么。也许touchesBegan不叫?你在寻找最佳做法吗? – LearnCocos2D
呃......没什么用。我的意思是,我卡在那里白衣这个全屏幕图像,我不能回去。我会编辑我的问题,对不起。 – Oiproks