我想知道如何在iOS上的UITableView中为音乐文件创建通用音乐图像,例如图像文件的通用图片图像。这是一张我正在尝试做的图片http://smartlifeblog.com/wp-content/uploads/2012/02/dropbox-ios.jpg
到目前为止,我有代码来显示我的文档目录中的文件
static NSString *CellIdentifier = @"FileCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [files objectAtIndex:indexPath.row];
return cell;我可以在表中添加一个映像,但我不确定如何为适当的文件类型加载适当的映像。
发布于 2012-08-11 12:03:46
参见UIDocumentInteractionController。它是用文件URL初始化的。然后,icons属性为您提供该文件的图标数组,从小到大排序。这适用于操作系统已知的所有文档类型。您可以在应用程序的Info.plist中使用图标注册其他类型。
https://stackoverflow.com/questions/11911507
复制相似问题