2011-10-07 2 views

답변

0

목록 끝에 더미 셀을 추가하십시오. (가) 더미 행 의 필요한 수를 추가 - (NSInteger)있는 tableView :

+0

내가 그렇게 할 수 있지만 Monotouch에 대한 코드이 번역 할 수있는 더 적절한 방법 – spentak

2

다음과 같은 몇 가지 일을하려고 (jQuery과 *)있는 tableView numberOfRowsInSection : (NSInteger) 섹션 {

if ([UIAppDelegate.getwaitlistArray count]>=numberOfVisibleRowsOnYourScreen) { 
    return [UIAppDelegate.getwaitlistArray count]; 
} 
else{ 
    return ([UIAppDelegate.getwaitlistArray count] + numberOfVisibleRowsOnYourScreen - [UIAppDelegate.getwaitlistArray count]); 
} 

}
(b)는 휴대 Alternare :

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ 
//alternating cell back ground color 
if (indexPath.row%2 == 0) { 

    [cell setBackgroundColor:[UIColor colorWithRed:237.0/255.0f green:237.0/255.0f blue:237.0/255.0f alpha:1.0f]]; 
}else 
{ 

    [cell setBackgroundColor:[UIColor colorWithRed:247.0/255.0f green:247.0/255.0f blue:247.0/255.0f alpha:1.0f]]; 
} 

}

(C) cellF에서 orRowAtIndexPath :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"]; 
if (cell == nil) { 
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyIdentifier"] autorelease]; 
    cell.selectionStyle = UITableViewCellSelectionStyleNone; 
} 
//Create your lables/buttons/text/image 
nameLabel.test=@"Whatever"; ..... ...... 

......

if (indexPath.row < [YourArray count]) { Populate your data here in the cells } else { cell.userInteractionEnabled=FALSE; [email protected]""; } return cell; } 
+0

이 있다면 궁금 해서요? – callisto

관련 문제