【发布时间】:2016-07-20 18:36:09
【问题描述】:
我的要求是在表格视图单元格中显示圆形图像。为此,在行的单元格中,我为我的 imageview 的出口提供了角半径,现在图像以圆形格式显示,但是当滚动单元格时,如果我停止角半径代码正常工作,任何人都可以告诉我这个问题吗?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *cellIdentifier =@"notification";
NotifiucationTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[NotifiucationTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
}
ZSAnnotation *objArray = [personDetails objectAtIndex:indexPath.row];
[cell.profilePic sd_setImageWithURL:[NSURL URLWithString:objArray.personImage]
placeholderImage:[UIImage imageNamed:@"profile-pic-big.png"]];
cell.personDescription.text = objArray.personDescription;
cell.personTitle.text = objArray.personTitle;
myString = [[NSNumber numberWithFloat:objArray.rating] stringValue];
km = [NSString stringWithFormat:@"%@%@", myString, @" KM"];
cell.personNearbyDistance.text = km;
[cell.callButton addTarget:self action:@selector(callButtonAction:) forControlEvents:UIControlEventTouchUpInside];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.backgroundColor = [UIColor whiteColor];
cell.profilePic.layer.cornerRadius = 30;
return cell;
}
【问题讨论】:
-
您签入设备了吗?你有问题吗?
-
是的,我签入了 iPad,但遇到了问题
-
可以上传截图吗?
-
添加“cell.profilePic.layer.masksToBounds = YES;”
标签: ios objective-c iphone uitableview uiimageview