뷰가 tableViewCell 안에 있습니다. 특정 조건에서보기를 원점 x
으로 옮기고 싶지만 다음 코드는 cellForRowAtIndexPath
에서 작동하지 않습니다. cellForRowAtIndexPath
이 완료되면 코드를 사용하면 정상적으로 작동합니다.cellForRowAtIndexPath에서 셀 내부의 뷰 프레임이 변경되지 않습니다.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UINib *nib = [UINib nibWithNibName:@"GoalDetailsCustomCardCell" bundle:nil];
[goalDetailsTableView registerNib:nib forCellReuseIdentifier:@"CardCell"];
GoalDetailsTableViewCell *cell = [goalDetailsTableView dequeueReusableCellWithIdentifier:@"CardCell"];
if(cell == nil)
{
cell = [goalDetailsTableView dequeueReusableCellWithIdentifier:@"CardCell"];
}
if([self.swipedRowArray containsObject:indexPath])
{
[UIView animateWithDuration: 0.5 animations:^{
cell.cardDetails.frame = CGRectOffset(cell.cardDetails.frame, -322.0, 0.0);
// CGRectOffset(cell.cardView.frame, -320.0, 0.0);
cell.actionCardReminder.frame = CGRectOffset(cell.actionCardReminder.frame, -322.0, 0.0);
}];
}
}
누구든지 도와주세요 .. 미리 감사드립니다.
다음과 같이 시도하십시오. GoalDetailsTableViewCell * cell = [goalDetailsTableView dequeueReusableCellWithIdentifier : @ "CardCel % d", indexPath.row]; –
너무 작동하지 않습니다. –