2011-12-15 10 views

答えて

2

はそれを行うための一つの方法は、の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; 
} 

これは、テーブルの各セルの右側にステッパーを追加します。

+0

これは特定の画面サイズでは機能しません – DaynaJuliana

関連する問題