I've an UIImageView
in customized UITableViewCell
and I want to resize it, I set it view mode to LEFT. To resize I'm applying below code.
[cell.IBImage setFrame:CGRectMake(201,12,50,20)];
My image width is 100 and I want to reduce is to 50 but it still shows me in 100 width. If I set view mode to Scale To Fill
it works fine but I want to have it's view mode to LEFT.
Full method cellForRowAtIndexPath is as given below:
- (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;
}