2013-01-21 1 views
0
-(void)viewWillAppear:(BOOL)animated{ 
    self.cell4.frame = CGRectMake(self.cell4.frame.origin.x, self.cell4.frame.origin.y, self.cell4.frame.size.width, self.cell4.frame.size.height + 60); 
    self.cell5.frame = CGRectMake(self.cell5.frame.origin.x, self.cell5.frame.origin.y + 60, self.cell5.frame.size.width, self.cell5.frame.size.height); 
} 

셀의 프레임이 변경되었음을 발견했으나 변경되지 않았습니다. 어떤 일을해야합니까?왜 viewWillAppear에서 셀의 프레임을 변경할 수 있습니까?

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 
    // set cell's height yourself 

} 

에서

+0

새로 고침을하셨습니까? – Larme

+0

@Larme 예, [self.tableView reloadData]를 추가했지만 사용하지 않습니다. – ZhouQi

+0

시도하지 않았지만 이유가 될 수있는'viewWillAppear' 다음에'tableView : cellForRowAtIndexPath'가 호출되는지 확인하십시오. – Larme

답변

0

쓰기 코드는 해결됩니다.

관련 문제