objective-c - 对齐不同大小的图像

标签 objective-c ios uitableview

我有不同大小的图像作为 tableview 的缩略图输入,有没有办法使所有图像对齐,尽管它们大小不同?因为在我的例子中,文本的位置将跟随图像,所以它不会整齐。 这是我用来输入图像的代码

static NSString *CellIdentifier = @"Cell"; 
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.textLabel.text = title;
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.imageView.image = thumb;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;

最佳答案

您始终可以根据需要设置 imageViewtextLabel 对象的框架。

关于objective-c - 对齐不同大小的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6136036/

相关文章:

objective-c - UITableView 的 indexPathForCell : returns always 0 as indexPath. 行

ios - 导航栏显示在 Storyboard 中但不显示在模拟器中

iphone - 有关在 iOS 时钟应用程序中重新创建 "Add Alarm"表单的问题

ios 8 在滚动时隐藏导航 Controller 并在向上滚动一点时再次显示

ios - ABAddressBookSave 导致 EXC_BAD_ACCESS ARC 已启用

ios - Objective C 中 iOS 的图像模糊检测

ios - 如何强制 UICollectionView 滚动到特定行并加载该行的单元格,同时隐藏 Collection View ?

ios - ARC weak ivar 在返回之前发布 - 构建发布时,而不是调试

ios - 在iOS 6.0中找不到AVAudioPlayer

iphone - objective-c - 标签变量