我有不同大小的图像作为 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;
最佳答案
您始终可以根据需要设置 imageView
和 textLabel
对象的框架。
关于objective-c - 对齐不同大小的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6136036/