Sheet can not be presented because the view is not in a window的解决办法,和window的简单使用
Sheet can not be presented because the view is not in a window,顺便在stackoverflow上找了答案,希望能给大家带来帮助,在此感谢我的朋友们。
1.
UIWindow* window =[[UIApplication sharedApplication] keyWindow];
if([window.subviews containsObject:self.view])
{[emailSheet showInView:self.view];}
else{[emailSheet showInView:window];}
2.
[actionSheet showInView:[[[[UIApplication sharedApplication] keyWindow] subviews] lastObject]];
Sheet can not be presented because the view is not in a window的解决办法,和window的简单使用的更多相关文章
- MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法
打开所在的wordspace文件夹,在下面子文件夹 .metadata\.plugins\org.eclipse.core.runtime\.settings\com.genuitec.eclipse ...
- MarkdownPad 2 在win10下出错:HTML 渲染错误(This view has crashed) 的解决办法 + MarkdownPad2.5 注册码
首先附上MarkdownPad2.5的注册码. 邮箱:Soar360@live.com 授权密钥: GBPduHjWfJU1mZqcPM3BikjYKF6xKhlKIys3i1MU2eJHqWGImD ...
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
在 IOS 开发当中经常碰到 whose view is not in the window hierarchy 的错误,该错误简单的说,是由于 "ViewController" ...
- android 自定义view中findViewById为空的解决办法
网上说的都是在super(context, attrs);构造函数这里少加了一个字段, 其实根本不只这一个原因,属于view生命周期的应该知道,如果你在 自定义view的构造函数里面调用findVie ...
- Android中View类OnClickListener和DialogInterface类OnClickListener冲突解决办法
Android中View类OnClickListener和DialogInterface类OnClickListener冲突解决办法 如下面所示,同时导入这两个,会提示其中一个与另一个产生冲突. 1i ...
- MyEclipse server窗口 Could not create the view: An unexpected exception was thrown 错误解决
MyEclipse 打开后有时候莫名的在server窗口里抛出“Could not create the view: An unexpected exception was thrown”错误,解决办 ...
- no drawer view found with gravity RIGHT(Android实现侧滑菜单从右面滑出) 解决办法
代码如下: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width ...
- UIScrollView上面放一个UIScrollView或者UITableView拖动时候 View出现一闪一闪解决办法
在项目中发现一个问题: 创建一个UIScrollView 上面放一个scrollView或者TableView,拖动scrollview或TableView 画面出现一闪一闪的情况. 解决办法设置一下 ...
- View not attached to window manager crash 的解决办法
View not attached to window manager crash 的解决办法 转自:http://stackoverflow.com/questions/22924825/view- ...
随机推荐
- Linux内核零碎知识
UNIX系统:内核.shell外壳.文件系统.工具或应用程序. 操作系统功能:进程与处理机管理.存储管理.设备管理.作业管理.文件管理. 内存是磁盘的缓存,cache是内存的缓存. 可把内核看作是不断 ...
- android 获取字符串的方法
字符串数组可以在value文件夹中声明: 书写的内容是: 两者的读取方式略有不同: 如果是读取数字的话, 使用: context.getResources().getStringArray( R.a ...
- HDUoj-------(1128)Self Numbers
Self Numbers Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- nyoj-----284坦克大战(带权值的图搜索)
坦克大战 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 Many of us had played the game "Battle city" ...
- 移动前端开发的viewport总结整理
1.通俗讲移动设备上的viewport就是设备的屏幕上能用来显示我们的网页的那块区域,但不是浏览器可视区域.一般来讲,移动设备上的viewport都要大于浏览器的可视区域.移动设备上的浏览器会把默认的 ...
- Storm(2) - Log Stream Processing
Introduction This chapter will present an implementation recipe for an enterprise log storage and a ...
- 转。管理Gearman
通常,Gearman被用来分发任务,以便实现异步操作.下面捋捋如何管理Gearman. 说明:请自行安装好Gearman和PHP PECL Gearman. 准备 我们先来创建一个Worker,实现一 ...
- java二维数组的定义
java中的一维数组的定义都熟了,但是二位数组和一维数组的定义有些微差别.在网上看到了篇文章,总结的很详细.转载下了. 原文链接[http://blog.sina.com.cn/s/blog_6189 ...
- C#中三种定时器对象的比较
·关于C#中timer类 在C#里关于定时器类就有3个1.定义在System.Windows.Forms里2.定义在System.Threading.Timer类里3.定义在System.Timers ...
- css默认样式
html, address,blockquote,body, dd, div,dl, dt, fieldset, form,frame, frameset,h1, h2, h3, h4,h5, h6, ...