0
UITableView를 모든 셀에 프로그래밍 방식으로 추가하려면 어떻게합니까?프로그래밍 방식으로 셀 안에 UiStepper 추가
감사
루카 그것이있는 tableView의 서브 뷰 각 셀에 UIStepper을 추가하는 것입니다 할
UITableView를 모든 셀에 프로그래밍 방식으로 추가하려면 어떻게합니까?프로그래밍 방식으로 셀 안에 UiStepper 추가
감사
루카 그것이있는 tableView의 서브 뷰 각 셀에 UIStepper을 추가하는 것입니다 할
한 가지 방법 : 당신의 TableViewController에 cellForRowIndexAtPath. 예 :
- (UITableViewCell*) tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString* CellIdentifier = @"Cell";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
UIStepper* stepper = [[UIStepper alloc] init];
stepper.frame = CGRectMake(220, 10, 100, 10);
[cell.contentView addSubview: stepper];
}
return cell;
}
이렇게하면 표의 각 셀 오른쪽에 스테퍼가 추가됩니다.
특정 화면 크기에서는 작동하지 않습니다. – DaynaJuliana