调用 UIImagePickerViewController 时状态栏返回?

发布于 2025-01-07 18:24:33 字数 548 浏览 0 评论 0原文

我的应用程序中的所有内容都运行良好 - 但有一个棘手的问题。

UIImagePickerController 似乎在调用时返回状态栏。显然,该应用程序的状态栏始终隐藏。

现在我已经通过在完成或取消选择器时重新隐藏它来解决这个问题。这导致应用程序顶部出现黑条。因此,在重新隐藏之后,我必须重新定位标题栏和其他表格内容以使其适合。

总而言之,这工作得很好。然而,UIImagePickerController 是在表格的详细视图中调用的。因此,当用户使用选择器(并且在使用后调整大小)并单击后退按钮返回主表时,会出现一个小的图形故障。

详细信息视图已向上移动以隐藏状态栏空白,但是当我返回主表并且应用程序水平滑回主视图时,在详细信息视图上的项目上方可以看到一瞬间的 20px 黑框?

回顾一下。 UIImagePickerController 返回状态栏(似乎无论如何),在编码以摆脱并重新格式化视图后,我在返回主视图时遇到时间(混乱)图形问题。

当然有一种方法可以阻止状态栏返回,这样我就不必使用代码退出状态栏了?我已将其在 plist 中设置为“关闭”。

很奇怪!干杯

Everything in my app is working a treat - but there is one niggling problem.

The UIImagePickerController seems to return the status bar when it is called. Obviously the app has the statusbar hidden throughout.

Now I have worked around this by rehiding it upon completion or canelation of the picker. This resulted in a black bar at the top of the app. So after the rehide I have had to reposition the titlebar and other table contents for it to fit.

All in all this works perfectly fine. However, the UIImagePickerController is called in detail view of a table. Therefore when the user has used the picker (and ive resized after use) and clicks the back button to return to the main table there is a small graphical glitch.

The detail view has been shifted up to hide the statusbar void, yet when I return to the main table and the app slides horizontally back to the main view, for a split second a 20px black box can be seen above the items on the detail view?

To recap. UIImagePickerController returns the staus bar (seemingly no matter what) and after coding to get rid and reformat the view I get a time (messy) graphical issue when returning to the main view.

Surely there is a way to stop the statusbar returning so I dont have to bodge bar back out using code? I have it set 'off' in the plist.

It very odd! Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

假装不在乎 2025-01-14 18:24:33

这对我有帮助。

1) 您必须委托 UIImagePickerController

2) 将其添加到 ViewController:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{    // Esconder el StatusBar. Provocado por el iOS7 y el UIImagePickerController
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
}

This helps to me.

1) You must delegate the UIImagePickerController

2) Add this to ViewController:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{    // Esconder el StatusBar. Provocado por el iOS7 y el UIImagePickerController
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
}
画▽骨i 2025-01-14 18:24:33

实现UIimagepicker控制器使用this.and隐藏状态栏到plist(statusbar初始隐藏= true)并设置Uiview大小320x480&实施这个

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
    {
        UIImagePickerController *picker= [[UIImagePickerController alloc]init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:picker animated:YES];
        [picker release];
    }

implementing UIimagepicker controller use this.and hide status bar in to plist(statusbar initialy hidden=true) and set Uiview size 320x480 & implementing this

if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
    {
        UIImagePickerController *picker= [[UIImagePickerController alloc]init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:picker animated:YES];
        [picker release];
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文