我需要在 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");
}
图像图片是
最佳答案
图像属性在 iOS 3.0 中已弃用。 您可以设置单元格的 ImageView ,但它是只读属性,因此您无法调整它的大小。
通过添加自定义 ImageView ,您可以解决您的问题。
关于iphone - 如何调整 uitableview 单元格图像的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8641507/