UIImageView
カスタマイズしてUITableViewCell
サイズを変更したいので、表示モードを左に設定します。サイズを変更するには、以下のコードを適用しています。
[cell.IBImage setFrame:CGRectMake(201,12,50,20)];
画像の幅が 100 で、50 に縮小したいのですが、それでも幅 100 で表示されます。表示モードを設定すると正常に動作しますScale To Fill
が、表示モードをLEFTにしたいです。
完全なメソッド cellForRowAtIndexPath は以下のとおりです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"DetailCell";
DetailCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"DetailCell" owner:self options:nil];
cell = (DetailCell *)[topLevelObjects objectAtIndex:0];
clsDetailResponse *Response = [self.Histories objectAtIndex:[indexPath row]];
[cell.IBUsernameLabel setText:[NSString stringWithFormat:@"%@ %@", Response.Firstname, Response.Lastname]];
[cell.IBImage setFrame:CGRectMake(201, 12, 50, 20)];
return cell;
}