iPhone - 以编程方式删除状态栏 [英] iPhone - Remove status bar programmatically

查看:75
本文介绍了iPhone - 以编程方式删除状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个实现iPhone相机的应用程序。
当用户完成选择图像后,状态栏会重新出现!
我如何确保状态栏保持隐藏?

I have made an app that implements the iPhone's camera. When the user finishes picking their image, the status bar reappears! How would I make sure that the status bar stays hidden?

这是我的代码:

-(IBAction)pickImage:(id)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
background.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

}

如果我做错了什么,请指出来!
谢谢,
Rafee

If i am doing anything wrong, please point it out! Thanks, Rafee

推荐答案

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];

如果有的话,您可以选择其他动画风格。

You may opt for another animation style if at all.

这篇关于iPhone - 以编程方式删除状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆