navigationItem.prompt & UIImagePickerController

发布于 2024-08-18 04:32:10 字数 672 浏览 5 评论 0原文

是否可以调用 UIImagePickerController 上的 navigationItem?具体来说,图像选择器?下面我链接了我想要实现的目标的图像(从执行相同操作的另一个应用程序获取的屏幕截图)。一旦用户从选择器中选择了图像,navigationItem.prompt 就会被设置,尽管我认为这可能是 HIG 违规,但右栏按钮会从标​​准取消按钮更改。我可以在“正常”视图上设置提示,没有问题:

self.navigationItem.prompt = myString;

但是,当我尝试在选择器的上下文中使用它时,这似乎不起作用:

myPicker.navigationItem.prompt = myString;

我尝试在创建选择器时以及在 didFinishPickingMediaWithInfo: 中使用它,这确实是我需要设置它的地方,因为我让用户选择多个图像,而不是在选择一个图像后立即关闭选择器。似乎没什么作用。

这是所需行为的图像:

http://i51.photobucket.com/ albums/f353/zoso5th/after.png

Is it possible to make calls to navigationItem on a UIImagePickerController? Specifically, the image picker? Below I've linked an image of what I'm trying to achieve ( screen shot taken from another app doing the same thing). Once the user selects an image from the picker the navigationItem.prompt is set and, though I think it might be a HIG violation, the right bar button is changed from the standard cancel button. I can set the prompt on a "normal" view no problem with:

self.navigationItem.prompt = myString;

But this does not seem to work when I try to use it in the context of a picker with:

myPicker.navigationItem.prompt = myString;

I've tried using it when the picker is created and also in didFinishPickingMediaWithInfo: which is really where I need to set it as I'm letting the user select multiple images instead of dismissing the picker as soon as one image is selected. Nothing seems to work.

Here's a image of the desired behavior:

http://i51.photobucket.com/albums/f353/zoso5th/after.png

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

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

发布评论

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

评论(2

故事还在继续 2024-08-25 04:32:10

有人在苹果开发论坛上为我回答了这个问题:

UINavigationBar *bar = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"Some new prompt";

我没有正确访问导航栏。

Someone answered this for me on the Apple dev forums:

UINavigationBar *bar = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"Some new prompt";

I wasn't correctly accessing the navbar.

喜你已久 2024-08-25 04:32:10

有人在 Apple 开发论坛上为我回答了这个问题:
UINavigationBar *bar = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"一些新的提示";
我没有正确访问导航栏。

在调用“presentModalViewController”后使用代码......如下所示...

[controllerpresentModalViewController:imagePickerControlleranimated:YES];

UINavigationBar *栏 = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"一些新的提示";

Someone answered this for me on the Apple dev forums:
UINavigationBar *bar = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"Some new prompt";
I wasn't correctly accessing the navbar.

Use the code after calling 'presentModalViewController'.....like below...

[controller presentModalViewController:imagePickerController animated:YES];

UINavigationBar *bar = picker.navigationBar;
UINavigationItem *navItem = bar.topItem;
navItem.prompt = @"Some new prompt";

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文