- 浏览: 572357 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
JYY282:
[i][/i]
Ecshop与Shopex的比较 -
qq247890212:
我也遇见这问题了,真诡异。重新下载个猫换了就好了。 太浪费时间 ...
诡异:ClassNotFoundException: org.springframework.web.filter.CharacterEncoding
http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html#//apple_ref/doc/uid/TP40010156-CH15-SW8
On devices with high-resolution screens, the imageNamed:
, imageWithContentsOfFile:
, and initWithContentsOfFile:
methods automatically looks for a version of the requested image with the @2x
modifier in its name. It if finds one, it loads that image instead. If you do not provide a high-resolution version of a given image, the image object still loads a standard-resolution image (if one exists) and scales it during drawing.
http://www.cocoachina.com/bbs/read.php?tid-59896.html:
例如:
我只有1@2x.png
當我用
UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"1" ofType:@"png"]];
Return 一定是nil
一定要用
UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"1@2x" ofType:@"png"]];
才會返回圖片
------------------------------
[ NSBundle mainBundle ] pathForResource: @"1@2x.png" ofType: nil ]
这里就返回nil了,可以这么做,
NSString * path = [[ NSBundle mainBundle ] resourcePath ];
path = [path stringByAppendingPathComponent:@"1.png"];
UIImage *img = [UIImage imageWithContentsOfFile:path];
不明白你为啥要这么做,要提醒你的是,你的程序不能
* 在安装了ios4.0以前地设备上跑,包括iphone4,如果安装了老系统的话
* 在非高分屏设备,如3g, 3gs上跑(即使ios装了4.0以上)
因为你没有非高分屏的图。
发表评论
-
Objective-C 与 C++ 的异同
2013-04-02 12:03 1370http://www.cnblogs.com/y041039 ... -
Cocos2D-X是全球知名的开源跨平台手机游戏引擎
2013-01-22 10:05 2722http://www.oschina.net/p/cocos ... -
iOS Keyboard 键盘高度变化 自适应
2013-01-15 15:43 3230[[NSNotificationCenter default ... -
iOS使用自定义字体
2012-11-27 12:11 12092From: http://blog.csdn.net/csy1 ... -
4 款类似 Facebook/Path 切换效果的 iOS 组件
2012-11-27 12:03 2121From: http://blog.csdn.net/lia ... -
Path 2.0的UI界面设计详细介绍
2012-11-27 11:56 1438如Path的创始人Dave Morin ... -
史上最全的App Store邮箱列表
2012-11-27 11:51 1239From: http://roybaby.blog.51cto ... -
iOS从info.plist 获取项目的名称及版本号
2012-11-16 10:54 1593From: http://blog.sina.com.cn/s ... -
MapKit annotation drag and drop with callout info update
2012-10-13 10:38 2377http://hollowout.blogspot ... -
NSArray 或NSDictionary 调用writeToFile方法失败原因
2012-08-31 10:03 4435NSArray 或NSDictionary 调用writeTo ... -
如何让IOS应用从容地崩溃
2012-08-30 15:25 1582From: http://www.cocoachina.com ... -
iOS中判断设备系统版本
2012-08-29 17:17 31677在iOS开发中,经常要考虑系统的向下兼容,如果使用 ... -
iOS 汉字转拼音
2012-08-21 16:42 1440From: http://www.cnblogs.com/v2 ... -
iOS模拟器截图工具
2012-08-17 16:35 1604From: http://magicalboy.com/ios ... -
XCode下的iOS单元测试
2012-08-10 17:47 1133From: http://mobile.51cto.com/ ... -
AFNetworking
2012-08-08 10:54 4631AFNetworking on github: https:/ ... -
Wrapping Conventions
2012-08-01 15:54 787Wrapping Conventions ... -
Core Animation如何使显式动画结束时的值直接作用Layer
2012-08-01 14:51 3761(1)使用隐式动画会直接改变layer的属性值,如: ima ... -
How To Debug Memory Leaks with XCode and Instruments Tutoria
2012-07-31 16:30 1024From: http://www.raywenderlich. ... -
Using Properties in Objective-C Tutorial
2012-07-31 16:27 886From: http://www.raywenderlich. ...
相关推荐
[UIImage generateSuitImagesWithOriginImagePath:@"/Users/todot/Desktop/cut" newImagePath:nil originImageType:DOTOriginImageType3x autoGenerateEnLargeImage:NO]; /* // 如果提供的切图是@2x的图片 ...
STPhotoBroswer * broser = [[STPhotoBroswer alloc]initWithImageArray:@[[UIImage imageNamed:@"1.jpg"],[UIImage imageNamed:@"2.jpg"],[UIImage imageNamed:@"3.jpg"],[UIImage imageNamed:@"1.jpg"],[UIImage ...
OC Extension UIImage+FHXImage(图片扩展) 针对UIImage进行封装的工具类。 /** 输入图片颜色返回一张图片 */ + (UIImage *)createImageWithColor:(UIColor *)color; /** 裁切图片的一个点进行延伸 */ - ...
UIImage-PDF ,UIImage-PDF 是 UIImage 的分类,实现让 UIImage 支持 PDF 文档的显示...
[self setClockBackgroundImage:[UIImage imageNamed:@"xxx"].CGImage]; [self setSecHandImage:[UIImage imageNamed:@"xxx"].CGImage]; [self setMinHandImage:[UIImage imageNamed:@"xxx"].CGImage]; [self ...
1.UIImage+ImageEffects是Accelerate框架中的内容 2.UIImage+ImageEffects的模糊效果非常美观 3.修改过的UIImage+ImageEffects可以对图片进行局模糊
UIImage+Sprite+Animmation
att_str = [SHAttributedString attributedPhoneStringWithString:att_str insertImage:[UIImage imageNamed:@"chatBar_colorMore_audioCallSelected@2x"] orPhoneNameString:nil isCall:NO]; //识别邮箱 att_...
WebP-UIImage-源码.rar
if found MyImage-568h@2x.png // 2. if found MyImage@2x.png // 3. if found MyImage.png 贡献 叉它! 创建您的功能分支: git checkout -b my-new-feature 提交您的更改: git commit -am 'Add some feature' ...
[images addObject:[UIImage imageNamed:@"2"]];[images addObject:[UIImage imageNamed:@"3"]];[[HcdGuideViewManager sharedInstance] showGuideViewWithImages:images andButtonTitle:@"立即体验" ...
UIIMage 改变颜色和遮罩
iOS 实时录制视频 流转uiimage 边录制边播放 视频流播放
IOS应用源码——UIImage+Sprite for iOS.rar
HEInfiniteScrollView 一个简单的图片轮播器,支持左右滑动轮播及渐变式切换两种工作方式。 怎么用? #import "HEInfiniteScrollView.h" NSArray *images = @[[UIImage ... [UIImage imageNamed:@"image05.jpg"],
/** * 给图片加水印图片 * * @param image 水印图片 ...- (UIImage*)imageWaterMarkWithImage:(UIImage *)image imageRect:(CGRect)imgRect alpha:(CGFloat)alpha; /** * 同上 * * @param image 同上 *
UIImage-BlurredFrame, UIImage类别,模糊了UIImage的指定框架 UIImage+BlurredFrame是一个UIImage类别,模糊了UIImage的指定框架#Install使用 cocoapods 安装pod 'UIImage+BlurredFrame'#Usage
Uiimage+category,uiimage+watermark,uiimageview+category实现对于图片添加水印的功能
方便查找图片,直接能够显示图片大小与内容,很方便,支持Xcode6