OGeek|极客世界-中国程序员成长平台

标题: iphone - Zbar wantFullScreenLayout=NO 使 imagePickerView 移动 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:47
标题: iphone - Zbar wantFullScreenLayout=NO 使 imagePickerView 移动

这听起来可能是一个新手问题,但我是 iOS 开发新手,

我在我的应用程序中使用 Zbar 二维码扫描器。我设置了 WantsFullScreenLayout = NO;所以状态栏变得可见。但是结果是我让 Zbar 的 ImagePickerView 移动到顶部,状态栏的大小,即在按钮中我得到灰色矩形

我的代码如下,

mReader = [[ZBarReaderViewController alloc] init];
mReader.readerDelegate = self;
mReader.showsZBarControls = NO;
[[UIApplication sharedApplication] setStatusBarHidden:NO];
mReader.wantsFullScreenLayout = NO;
mReader.readerView.torchMode = 0;
mReader.readerView.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);

如何摆脱灰色矩形?



Best Answer-推荐答案


对不起,真的是新手错误,基本上我还需要为我的 self.view 设置正确的大小。 这样做之后,我的问题就消失了,

self.view.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);

关于iphone - Zbar wantFullScreenLayout=NO 使 imagePickerView 移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8571560/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4