我有一個全屏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