1
我在用於行小區嘗試這種下面的代碼...如何爲cell.imageView.frame設置框架?
if([cell.textLabel.text isEqualToString:@"Home"])
{
cell.imageView.image = [UIImage imageNamed:@"Home-50.png"];
cell.imageView.frame=CGRectMake(10, 15, 20, 20);
}
這是下面的代碼是在Indexpath didselect行...
if ([[arrCell objectAtIndex:indexPath.row] isEqualToString:@"Home"]) {
cell.imageView.image = [UIImage imageNamed:@"Home1-50.png"];
cell.imageView.frame=CGRectMake(10, 15, 20, 20);
}
我用這上面的代碼來顯示圖像在tableview單元格和單元格單擊然後圖像更改爲另一圖像...圖像正在更改但幀,不適用...
ImageView的 - 是默認ImageView的或定製的ImageView –
更改中的任何標誌值select並重新加載tableview並更改單元格中的框在該標誌的索引路徑上行會更容易 –
[cell.imageView layoutifNeed];在調整幀大小之後放置這個 –