Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 709
Balaji Kondalrayal Avatar asked Dec 04 '14 09:12

Balaji Kondalrayal


1 Answers

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;
}
like image 171
Balaji Kondalrayal Avatar answered Nov 15 '22 05:11

Balaji Kondalrayal