一种解决的方法:CGContextSaveGState: invalid context 0x0
遇到这个问题找了好久答案,最后排错排出来了
CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability.
This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
在使用能够拉伸的图片时,希望保留圆角不被拉伸,使用了resizableImageWithCapInsets函数,可能是这个函数没有获取上下文才报的这个错。
于是加入上获取上下文的代码例如以下:
UIGraphicsBeginImageContext(imageViewSeparate.frame.size);
imageViewSeparate.image = [[UIImageimageNamed:@"切割线拉伸.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(1.0,10.0,
1.0,10.0)];
UIGraphicsEndImageContext();
一种解决的方法:CGContextSaveGState: invalid context 0x0的更多相关文章
- 编译器警告:CGContextSaveGState: invalid context 0x0
一.问题描述 下载图片,然后用Quartz2D绘制缩放的图片,运行无法显示图片并且编译器警告: Aug 18 21:41:50 02_计算UITableViewCell的行高[16777] < ...
- 【iOS】CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable
CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SH ...
- CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
最近在测试的过程中, 发现了SpringBoar的一个问题: SpringBoard[53] <Error>: CGContextTranslateCTM: invalid context ...
- invalid context 0x0.
在展示图片或者做二维码的时候,若是宽或者高有一个为零的情况就会报错:CGBitmapContextCreateImage: invalid context 0x0. If you want to se ...
- 关于CGContextSetBlendMode: invalid context 0x0的错误
在ios 7的模拟器中,选择一个输入框准备输入时,会触发这个错误,以下是出错详细日志: <Error>: CGContextSetBlendMode: invalid context 0x ...
- iOS关于CGContextSetBlendMode: invalid context 0x0的错误
在ios 7的模拟器中,选择一个输入框准备输入时,会触发这个错误,以下是出错详细日志: <Error>: CGContextSetBlendMode: invalid context 0x ...
- SQL Server 数据库没有有效全部者的三种解决的方法
问题: 开发的过程中,操作系统出了问题.决定重装系统.可是没有将SQL Server中的数据库文件分离出来,直接将系统格了.在新系统数据库中附加了数据库文件,一切还算正常.但当打开数据库关系图 ...
- Thinkphp 无法使用->order() 排序的两种解决的方法!
使用ThinkPHP,却发现无法使用->order($order)来排序. $order = " info.date2 desc "; 非常遗憾的是这样写结果order却变成 ...
- <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
转自这里 出 错原因:设置app的状态栏样式的使用使用了旧的方式,在info.plist里面设置了View controller- based status bar appearance为NO,默 ...
随机推荐
- 《vi中的替换艺术》-linux命令五分钟系列之十一
vi方面的内容不知道分类到哪里好,就放到<Linux命令五分钟系列>里吧! 今天编程,关于栈的一个小例子,其间我需要把”S.”替换为”S->”(替换不包括双引号). 其实这个不难,不 ...
- 系统默认字体Mac OS,Windows,XP,Lunix
可查获的信息太少,目前得知的是以中文为例, OS : Helvetical,Lucida Grande(西文默认字体) Windows 7: Microsoft Yahei Xp : Simsun,T ...
- python【第八篇】socket网络编程
内容大纲 1.socke基础 两个程序通过一个双向的通信连接实现数据的交换,这个连接的一端称为一个socket. 建 立网络通信连接至少要一对端口号(socket).socket本质是编程接口(API ...
- List<String^>^ 引用空间
莫名其妙报错 需要在.h和.cpp文件中都引用: using namespace System::Collections;using namespace System::Collections::Ge ...
- 通过搭建一个精简的C语言开发环境了解一个C程序的执行过程
一.如何搭建一个精简的C语言开发环境 准备:下载TC2.0,并解压,比如说“d:\tc2.0\tc”目录 1.在C盘建立一个目录minic c:\ md minic 2.从解压的目录中将以下文件拷贝到 ...
- event.preventDefault和恢复元素默认事件
写页面事件的时候,有的时候需要用event.preventDefault取消原有的事件后进行重写,这个大家应该都知道. 那么怎么在取消默认事件后再恢复呢. 解绑我们自定义的事件就好了. 以Jquery ...
- 转:gpio_request
今天再次学习SD卡驱动,遇到pgio_request这个函数,始终不知道其什么意思,看了几遍源代码才有了点感觉.现将其关键部分再此说明一下,以备自己以后复习,或是路客参考. 一般gpio_reques ...
- 转:misc_register、 register_chrdev 的区别总结
杂项设备(misc device) 杂项设备也是在嵌入式系统中用得比较多的一种设备驱动.在 Linux 内核的include/linux目录下有Miscdevice.h文件,要把自己定义的misc d ...
- 一种计算e的方法
原文地址:http://hankjin.blog.163.com/blog/static/3373193720108811316123/ 原理:平均e个(0,1)之间的随机数之和会大于1.原因:n个数 ...
- WebKit JavaScript Binding添加新DOM对象的三种方式
一.基础知识 首先WebKit IDL并非完全遵循Web IDL,只是借鉴使用.WebKit官网提供了一份说明(WebKitIDL),比如Web IDL称"operation”(操作), 而 ...