-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets只能通过imagedNamed? #5
Comments
愿闻其详 |
类似这样 |
你把最低系统改为9.0。然后获取的path就是nil了 |
这个是9.0之后的事情?我一直停留在最低7.0,运行在9.0上,正常的。难道只要吧最低版本降到9.0就可以使用? |
低版本的iOS系统不支持解包Assets文件,所以Xcode监测到到你需要支持低版本的iOS时候,会在打包ipa的时候把Assets里的图片全部拷贝一份到根目录下,所以你可以用ContentsOfFile读到图片 |
我刚测试了一下,如果是jpg文件,不会被打包到.car文件中,可以用ContentsOfFile读取到,打包的就不可以读取了 |
所以能读取的情况有条件限制, 而Apple本身就是希望Assets.car文件是无法解包的(我查了一下Apple是用CoreUI.framework解析car文件的), 这样在平时开发中, 就只能用imageNamed:来读取car中的图片了 |
现在Assets里面的图片不是可以通过imageWithContentsOfFile的方式获取的么?怎么看你前面说不可以的?
The text was updated successfully, but these errors were encountered: