检查Xcode中的图像大小

Soh*_*han 0 iphone xcode

当我在Xcode中将一些图像文件(仅限PNG格式)复制到我的应用程序中时,图像的大小是否会改变?

或者,我如何在xcode中检查我的PNG图像的大小?

提前致谢!

Cyp*_*ian 6

以下是如何以字节为单位打印大小:

UIImage *myImage = [UIImage imageNamed:@"xxx.png"];

NSLog(@"MyImage size in bytes:%i",[UIImagePNGRepresentation(myImage) length]);
Run Code Online (Sandbox Code Playgroud)