objective-c - UITableViewCell 中的 UIImage

标签 objective-c ios uitableview uiimage

我正在尝试将图像放入 UITableViewCell。我用 SSMessages我的消息的样式。 enter image description here

尝试了类似 cell.imageView.image = [UIImage imageNamed:message.messageText]; 的方法,但它不起作用。有什么建议么?也许需要我的其他代码?

最佳答案

使用 SSMessageTableViewCellBubbleView 的 leftBackgroundImage 并将其添加到您的 TableView 中

SSMessageTableViewCellBubbleView *imageBubbleView = [SSMessageTableViewCellBubbleView alloc]     init];
imageBubbleView. leftBackgroundImage = [UIImage imageNamed:message.messageText];

[cell.contentView addSubview:imageBubbleView];

我希望这能奏效!

关于objective-c - UITableViewCell 中的 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10093553/

相关文章:

arrays - 填充 UITableView 节标题标题,因为节 == 2?

ios - 重新加载 UITableView 中的部分

iphone - 新手指南 : Managing currency in iPhone app

ios - 在 Swift 中使用其他参数上传多个图像

json - 在 Swift 中使用来自 Rest API 的数组填充 UITableview

uitableview - iOS7 UITableViewCell 重新排序控件与 UITableViewCellStyleValue1 重叠 detailTextLabel

objective-c - 如何使用 Xcode 4 断点 Action

ios - 如何设置要在特定持续时间内选择的按钮?

ios - 类型 'StorageReference' 的值没有成员 'data' ?

Objective-C,释放一个对象两次?