iphone - 如何调整 uitableview 单元格图像的大小?

标签 iphone ios

我需要在 uitableviewcell 中调整相同的图像大小。我使用相同的页面,而不是使用另一个 View 。我把所有东西都放好就跑了。但我无法正确定位如何做到这一点。提前致谢。 这是代码

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
int count = 0;
if(self.editing && indexPath.row != 0)
    count = 1;

if(indexPath.row == ([imarry count]) && self.editing)
{
    cell.textLabel.text = @"ADD";
    cell.image= [UIImage imageNamed:@""];
    return cell;
}
cell.textLabel.text = [arry objectAtIndex:indexPath.row];
cell.image=[imarry objectAtIndex:(indexPath.row)];
return cell;    
 }


 - (void)imagePickerController:(UIImagePickerController *)UIPicker didFinishPickingImage:(UIImage *)info editingInfo:(NSDictionary *)dictionary
 {
[UIPicker dismissModalViewControllerAnimated:NO];
[imarry insertObject:info atIndex:[imarry count]];
[Table reloadData];
NSLog(@"Uploaded image");
}

图像图片是

enter image description here

最佳答案

图像属性在 iOS 3.0 中已弃用。 您可以设置单元格的 ImageView ,但它是只读属性,因此您无法调整它的大小。

通过添加自定义 ImageView ,您可以解决您的问题。

关于iphone - 如何调整 uitableview 单元格图像的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8641507/

相关文章:

iPhone : Hiding empty tables cells in a plain view table

iphone - iOS 6 应用商店 : URL to search for apps corresponding to defined keywords on Appstore?

iphone - 在运行时循环遍历所有对象属性

ios - 显示页面时出现 UiNavigation 错误

ios - 如何在不使用标签的情况下识别 UItextFields。

iphone - 如何实现iPhone日历日 View

iphone - 在 NSMutableArray Xcode 中存储经纬度

ios - CocoaPods:增加了AFNetworking的一半依赖

ios - Swift:延迟 UITableViewCell 选择

ios - 段错误 : 11 - Xcode 10