2014-12-04 86 views
8

我在tableviewcell內部有uiview。當我使用ios 8運行代碼時,表cell看起來不錯並且工作正常。但是當我嘗試在ios 7中運行此代碼時,表cell的內容與cell的其他內容重疊。tableviewcell內部視圖高度不同於ios 7和ios 8

任何人都可以幫助我做到這一點。

附Tableviewcell scrrenshot如下:

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; 
} 

在此先感謝。

+0

後一些代碼。 – NAZIK 2014-12-04 09:18:40

+0

我已經更新了我的問題。 – 2014-12-04 09:21:53

+0

@Hemang - 其實這涉及到我的最後一個問題,但問題是在iOS 7版本,我得到如上所示的圖像。同時刪除重複的標誌和-1 – 2014-12-04 09:54:59

回答

2

我已經自己解決了這個問題。

當你在運行ios7,只是在tableViewCell實現文件設置maskToBounds = YES

- (void)layoutSubviews 
{ 
    self.cardDetails.layer.masksToBounds = YES; 
} 
相關問題