Balaji Kondalrayal
Balaji Kondalrayal

Reputation: 1751

Height of View inside tableviewcell differs from ios 7 and ios 8

I have a uiview inside the tableviewcell. When i run the code with ios 8 the table cell look good and working fine. But when i try to run this code in ios 7 the table cell contents overlapping on the other content of the cell.

Can anyone help me to do that correctly.

Attached the Tableviewcell scrrenshot as follows:

view contents overlapping eachother

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

if(!self.customCell){
    self.customCell = [self.goalDetailsTableview dequeueReusableCellWithIdentifier:@"GoalDetailsCell"];
}

//Height of cell
float height = 360;
return height;
}

Thanks in advance.

Upvotes: 8

Views: 109

Answers (1)

Balaji Kondalrayal
Balaji Kondalrayal

Reputation: 1751

I have solved this issue by myself.

When you are running in ios7, just set maskToBounds = YES in tableViewCell implementation file.

- (void)layoutSubviews
{
    self.cardDetails.layer.masksToBounds = YES;
}

Upvotes: 2

Related Questions