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- ...
随机推荐
- file类之目录
可以解决的问题是: 有时需要列出目录下指定类型的文件,比如java,txt等扩展名的文件,可以使用File类的下述两个方法,列出指定类型的文件. /* file类实现两个 ...
- JS回调函数(callback)
在使用Jquery的时候,用到Callback(),回调函数的概念.而且很多. 比如: $.ajax({ url:"test.json", type: "GET" ...
- Android画一条横线
<View android:layout_width="match_parent" android:layout_height="1px" android ...
- jquery iframe高度自适应
$(document).ready(function () { $("#test").load(function () { var thisheight = $(this).con ...
- 20145236 《Java程序设计》实验三实验报告
实验三实验报告 和张亚军同学一组: 实验三实验报告
- Swing——JFrame
1.定义 相对于AWT(hevay weight component),Swing(hevay weight component)是轻量化的组件.Swing由纯Java Code 所写,解决了Java ...
- ios基础篇(三)——UIButton的详细介绍
按钮UIButton是ios开发中最常见的控件之一,下面来介绍UIButton的详细内容: 一.UIButton的定义 UIButton *button=[[UIButton buttonWithTy ...
- PHP Mongodb 基本操作
<?php include "config/config.inc.php";$host = $config['host'];$port = $config['port']; ...
- 闭包 (循环事件获取不到i) 和 各种解决循环获取不到i的解决方法
for(var i in fav){ (function(){ var p=i; var obj=$S.getId(fav[i]); ...
- C#.NET SQL数据库备份与还原解决方案
C#.NET SQL数据库备份与还原解决方案http://www.csframework.com/archive/1/arc-1-20110924-1841.htm 开发框架V2.2(快速开发版)系统 ...