搜索
您的当前位置:首页正文

UIImage初始化一张图片的方法

来源:二三娱乐

A. imageNamed:
B. initWithContentOfFile:
C.[[UIImage alloc] init]
D.imageWithCGImage:scale:orientation

</br>
</br>
</br>
</br>

正确答案:D
解析:
imageNamed:系统会检查系统缓存中是否有该名字的Image,如果有的话,则直接返回,如果没有,则先加载图像到缓存,然后再返回

initWithContentsOfFile:系统不会检查系统缓存,而直接从文件系统中加载并返回。

imageWithCGImage:scale:orientation 当scale=1的时候图像为原始大小,orientation制定绘制图像的方向

转载自《猿圈》

</br>
</br>

Top