将图像添加到表格单元格(iOS)
我正在尝试做类似于Twitter或Facebook的事情。
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { static NSString* CellIdentifier = @"Cell"; UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) cell = [[[UITableViewCell alloc] UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.textLabel.text = @"I'm a UITableViewCell!"; cell.imageView.image = [UIImage imageNamed:@"MyReallyCoolImage.png"]; return cell; }
感谢Thomas Moore
添加图像到UItableView
那么,要添加一个图像到一个表单元格,你可以添加一个UIImage到字幕UITableViewCell的图像属性或你自己的自定义单元格。 我会阅读在developer.apple.com上定制UITableViewCells的文档。
Swift版本:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell cell.textLabel.text = "I'm a UITableViewCell!"; cell.textLabel.textColor = UIColor.whiteColor() cell.imageView.image = UIImage(named: "MyReallyCoolImage.png") return cell; }
- 在没有包含缩略图的PIL的情况下,使用Python在EXIF中指定的方向旋转图像
- Swift如何修改从移动摄像头拍摄的图像中的exif信息
- caching图像和UICollectionView
- 你有没有从CameraRoll到一个新的视图控制器的方法?
- 如何在上传之前去除浏览器中的图片元数据(javascript)
- iPhone的图像video问题在video速度
- 该包不包含iMessage图标。 iMessage应用程序图标必须是.png格式的120×90像素
- 将图像编码为base64,获取无效的base64string(使用base64EncodedStringWithOptions的ios)
- Xcode界面构build器中的图像资产大小