- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在用户拍照或选择保存的照片后添加确认 View 。确认 View 将仅显示所选图像,工具栏中有取消和上传按钮。
我的 UIImagePickerController 从我的一个 View Controller 中以模态方式呈现,该 View Controller 由导航 Controller 控制,而导航 Controller 又由选项卡栏 Controller 控制。
如何以模态方式呈现我的确认 View ,以便在用户选择照片时它占据全屏(如图像选择器 View )?理想情况下,我想要这样的东西:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
UIViewController *modal = [[UIViewController alloc] init];
modal.view = confirmationView;
[self presentModalViewController:modal animated:YES];
[modal release];
}
但是,这会使应用程序崩溃。我应该从选择器中以模式方式呈现确认 View 吗?如果是这样,我如何确保当确认 View 被关闭时,选择器也不会显示?
编辑:
修复了我发布的代码中的错误。这就是当我尝试从内存中输入而不是复制+粘贴时发生的情况:(无论如何,到目前为止的建议没有帮助。
如果我呈现模态 Controller 然后关闭选择器,则不会发生任何事情,大概是因为两个 Controller 随后都被关闭了。
如果我关闭选择器然后显示模态 Controller ,我会收到有关模态转换的异常:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from <UINavigationController: 0x6b33940> to <UIViewController: 0x6b62b00> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed'
最佳答案
找到了解决方案。事实上,需要关闭选择器,技巧是关闭该关闭的动画,以便它立即发生,然后呈现第二个模态视图。
编辑:实际上,它几乎让我得到了我想要的。当您关闭选择器时,原始 View 会显示一瞬间,然后模态视图会变为动画。这看起来有点时髦。
我还尝试保留选择器而不是关闭它。相反,我调用[picker presentModalViewController:modalAnimated:YES]
。这让我可以顺利地从选择器过渡到确认 View 。但是,当我完成确认 View 时,我需要从原始 Controller 调用 [self DismissModalViewControllerAnimated:YES]
。这具有在忽略所有内容之前先显示图像选择器的效果。再说一遍,这并不完全是我想要的。
理想情况下,我想要 Facebook iPhone 应用程序用于上传照片的相同效果。选择照片后,它会无缝过渡到确认 View 。从该 View 取消或确认将平滑地过渡回原始主视图。它使得确认 View 看起来像是图像选择器的一部分,而实际上它可能只是另一个自定义 View 。
我该怎么做?
关于iphone - 从 UIImagePickerController 呈现另一个模态视图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3799879/
阅读目录 1、视图介绍 2、创建视图 3、查询视图 4、修改视图 5、删除视图 6、检查选项
基于函数的视图你已经get了,基于类的视图get了吗?CBV本质不知道?点进来看源码分析~ Django 视图之FBV 与 CBV FBV(function base views) 基于函数的视图,就
SQLite 视图(View) 视图(View)只不过是通过相关的名称存储在数据库中的一个 SQLite 语句。视图(View)实际上是一个以预定义的 SQLite 查询形式存在的表的组合。 视图
视图 什么是视图?视图的作用是什么? 视图(view)是一种虚拟存在的表,是一个逻辑表,它本身是不包含数据的。作为一个select语句保存在数据字典中的。 通过视图,可以展现基表(用来创建视图
代码如下: CREATE OR REPLACE VIEW BLOG_V_ADMIN (ID,NICKNAME,SEX,EMAIL,
创建视图 视图包含应用的 HTML 代码,并将应用的控制器逻辑和表现逻辑进行分离。视图文件存放在 resources/views 目录中。下面是一个简单的视图示例:
加密测试的存储过程 ? 1
简介数据库快照 数据库快照,正如其名称所示那样,是数据库在某一时间点的视图。是SQL Server在2005之后的版本引入的特性。快照
一 ,mysql事务 MYSQL中只有INNODB类型的数据表才能支持事务处理。 启动事务有两种方法 (1) 用begin,rollback,commit来实现 复制代码代码如
前言 在日常开发中,存储数据的最常用的方式便是数据库了,其中最为著名的便是MySQL数据库,因它简便易于上手而且可扩展性强大,跨平台使得它广为使用。上一篇文章,我们讲到了它的安装,今天我们就来
1、视图 视图:VIEW,虚表,保存有实表的查询结果,实际数据不保存在磁盘 物化视图:实际数据在磁盘中有保存,加快访问,MySQL不支持物化视图 基表:视图依赖的表 视图中的数据事实上
事项开启和使用 ? 1
代码如下: create PROCEDURE sp_decrypt(@objectName varchar(50)) AS begin begin tran&
前言 在之前 《Oracle打怪升级之路一》中我们主要介绍了Oracle的基础和Oracle常用查询及函数,这篇文章作为补充,主要介绍Oracle的对象,视图、序列、同义词、索引等,以及PL/SQL编
我是一名优秀的程序员,十分优秀!