ios - Assets 目录启动图像未用于 4 英寸模拟器

标签 ios iphone xcode image asset-catalog

出于某种原因,当我从 Assets 目录中以编程方式引用我的 4 英寸启动图像时,没有选择它?它使用 3.5 的默认启动图像。有什么线索吗?

UIColor *image = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"LaunchImage"]];
self.view.backgroundColor = image;

最佳答案

我没有使用启动图像 Assets 目录,而是创建了另一个具有相同图像的图像并将其用作背景图像引用。

UIColor *image = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"Background"]];
self.view.backgroundColor = image;

关于ios - Assets 目录启动图像未用于 4 英寸模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19651158/

相关文章:

iphone - 位置服务设置为 "On"时应用程序崩溃

ios - 删除单元格后使用自定义布局调整 UICollectionView 的大小

iphone - UITableViewController 拉动以使用卡住的 header 进行刷新

iphone - 地理位置 : Protocol on iPhone Safari

xcode - 如果有警告,阻止 Xcode 构建

ios - 在表格 View 单元格内单击按钮时执行功能

ios - NS_ENUM - 此处不允许定义函数

ios - Xcode 12.2 测试版 3 : ld: unknown option: -no_adhoc_codesign

iphone - 如何从我的应用程序访问 iphone 联系人?

swift - Xcode 8.2 Swift 编译器错误 : "Segmentation Fault: 11"