cellForRowAtIndexPathではなくwillDisplayCellで設定する必要があるみたいです。
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor purpleColor];
}
cellForRowAtIndexPathではなくwillDisplayCellで設定する必要があるみたいです。
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor purpleColor];
}
メモとして。。。
以下の二通りの方法で取得可能です。
戻り値の型が違うので注意が必要です。
//方法1
int width = CGImageGetWidth(image.CGImage);
int height = CGImageGetHeight(image.CGImage);
//方法2
float width = image.size.width;
float height = image.size.height;