셀 스타일 변경에 대한 질문. 콘텐츠 : 동적 원형섹션에 대한 uiTableview 셀 스타일 변경
코드섹션 번호 : 하나의 스토리 보드로 생성 한 레이아웃을 사용할 수있는 2
제 은 스토리 보드, I는 셀을 만들었다. 셀은 데이터베이스의 데이터로 완벽하게 채 웁니다. 섹션 2의 셀 레이아웃을 value1 스타일로 변경하려고합니다.
어떻게이 작업을 수행 할 수 있습니까?
코드의 일부 : 당신은 셀의 셀 스타일을 설정해야
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"cartCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
switch (indexPath.section) {
case 0:
{
// Configure the cell...
NSInteger row = [indexPath row];
[[cell textLabel] setText:[cartItems objectAtIndex:row]];
return cell;
break;
}
case 1:
{
NSInteger row = [indexPath row];
switch (row) {
case 0:
[[cell textLabel] setText:@"Total1"];
break;
case 1:
[[cell textLabel] setText:@"Total2"];
}
return cell;
break;
}
}
}
당신이 우리의 대답을 시도하고 당신이 최대 무엇에 대한 피드백을 제공한다 : 그리고 cellForRowAtIndexPath에, 단지 스위치 문 또는 절 다른-경우 내부에 원하는 식별자가 셀을 큐에서. –
답변을 살펴 봅니다. 나에게 시간을 좀주세요. 이것은 부업입니다. – TomVD