29,027
社区成员
发帖
与我相关
我的任务
分享
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
UIImageView * img=(UIImageView * )[[tableView cellForRowAtIndexPath:indexPath].subviews objectAtIndex:0];
return img.frame.size.height;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
//图片的url地址
NSString * str=[[[dataArr objectAtIndex:indexPath.row] objectForKey:@"file"] objectForKey:@"key"];
UIImageView * img1=[[UIImageView alloc] initWithFrame:CGRectMake(100, 0, 192, 100)];
[img1 setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:ImgUrl,str]]];
[cell addSubview:img1];
[img1 release];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.layer.borderColor=[UIColor blackColor].CGColor;
cell.layer.borderWidth=2;
return cell;
}