
继 how to reduce the size of app之后
我的ipa大小是19 MB.使用.zip扩展名重命名该文件,然后双击它.在Payload文件夹中找到应用程序并右键单击它并选择显示包内容.发现exec是25MB和一些大尺寸的图像.我怎样才能减少exec的大小?因为我想减少商店中app的大小
任何想法/建议都会非常有帮助
解决方法 >您可以从互联网上加载高分辨率图像>优化闪屏图像,删除Alpha,制作8bit颜色
>使用伪AJPEG image.png image_mask.jpg
#define maskedCacheStorePath [[NSSearchPathForDirectorIEsInDomains(NSCachesDirectory,NSUserDomainMask,YES) objectAtIndex:0] stringByAppendingPathComponent:@"maskedImageCache"]+ (UIImage *)maskedImagenamed:(Nsstring *)imagename useCache:(Boolean)useCache { Nsstring *imageCacheStorefile = nil; if (useCache) {if (![[NSfileManager defaultManager] fileExistsAtPath:maskedCacheStorePath]) [[NSfileManager defaultManager] createDirectoryAtPath:maskedCacheStorePath withIntermediateDirectorIEs:YES attributes:nil error:nil];imageCacheStorefile = [maskedCacheStorePath stringByAppendingPathComponent:[Nsstring stringWithFormat:@"%@.png",imagename]];if ([[NSfileManager defaultManager] fileExistsAtPath:imageCacheStorefile]) return [UIImage imageWithContentsOffile:imageCacheStorefile]; } UIImage *image = [UIImage imagenamed:[imagename stringByAppendingPathExtension:@"jpg"]]; UIImage *mask = [UIImage imagenamed:[[imagename stringByAppendingString:@"_mask"] stringByAppendingPathExtension:@"png"]]; CGImageRef ref = CGImageCreateWithMask(image.CGImage,mask.CGImage); UIImage *result = [UIImage imageWithCGImage:ref scale:image.scale orIEntation:image.imageOrIEntation]; CGImageRelease(ref); if (useCache && result)[UIImagePNGRepresentation(result) writetofile:imageCacheStorefile atomically:YES]; return result;} 也看看this question答案
总结以上是内存溢出为你收集整理的ios – 减少.ipa中的可执行文件的大小全部内容,希望文章能够帮你解决ios – 减少.ipa中的可执行文件的大小所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)