我有WKInterfaceTable
一个 WatchKit 应用程序。表中的每一行都有一个图像和一个标签。awakeWithContext
在第一次加载接口控制器时,我在or中设置了表格willActivate
,一切正常。标签和图像按预期显示其内容。但是,如果我重新加载表格以响应用户选择一行,所有图像都会消失。
我正在使用setImageNamed:
设置WKInterfaceImage
WatchKit 应用程序包中的图像。我已经尝试将图像放在资产文件中并单独包含在项目中。是什么赋予了?
我设置和重置表格的代码如下所示:
[self.table setNumberOfRows:self.rowData.count withRowType:@"myRowType"];
for (NSInteger i = 0; i < self.table.numberOfRows; i++)
{
MyRowClass row = [self.table rowControllerAtIndex:i];
MyDataClass data = [self.rowData objectAtIndex:i];
[row.label setTitle:data.title];
[row.image setImageNamed:@"MyImage.png"];
}