사용자 정의 셀을 만들었으므로 contentView의 프레임을 변경하고 싶습니다. 내 셀은 CustomCell입니다. cellforrowatindexpath에서 contentView 프레임을 변경하는 방법은 무엇입니까?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"hey");
static NSString *CellIdentifier = @"CustomCellReuseID";
AbcCustomCell *cell = [tabel_Abc dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[AbcCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString *name= [arrayTabel_Abc objectAtIndex:indexPath.section];
[cell setBackgroundColor:[UIColor clearColor]];
[cell.label_CellList setText:name];
cell.contentView.frame = CGRectMake (100,0,500,20);
return cell;
}
I는이 사용 cell.contentView.frame = CGRectMake (100,0,500,20); 하지만 나를 위해 작동하지 않습니다. customCell의 contentView를 변경하고 싶습니다. 아무도 나를 안내 할 수 있습니까 ?? 미리 감사드립니다.
자동 레이아웃을 사용하고 있습니까? –
예 UITableVIewCustomCell에서 AutoLayout을 사용하고 있습니다. – Sami