【发布时间】:2014-06-09 07:46:00
【问题描述】:
我有一个 UiVIewController,我在其中拖动了一个表格视图并放置了所有需要的连接,例如委托和数据源,它工作得很好,一切都很好。我试图为这个表格视图设置一个背景,但我得到了这个奇怪的错误
CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
我尝试使用这种方法设置背景:
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mypredictions_bg.png"]];
[tempImageView setFrame:self.tableView.frame];
self.tableView.backgroundView = tempImageView;
我错过了什么?我检查了图片的名字是正确的
【问题讨论】:
-
您的代码中是否有类似
[UIImage imagenamed:@""];的声明?因为当您尝试使用[UIImage imageNamed:myImage]加载图像但iOS未找到名称为myImage的图像时会出现警告 -
@BuntyM 我检查了那里的所有文件..我尝试以相同的方式加载,但在 tableviewcontroller 中它工作得很好,但在我的情况下它不会
标签: ios objective-c xcode uitableview uiviewcontroller