2012-07-19 57 views

回答

0

試試這個,點擊按鈕添加[yourtableview reloadData]

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

static NSString *CellIdentifier = @"Cell"; 


UITableViewCell *cell; 

cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];  

if(cell==nil) 
{ 
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 

} 
else 
{ 
    for(UIView *v in cell.contentView.subviews) 
    { 
     [v removeFromSuperview]; 
    } 
} 


cell.selectionStyle = UITableViewCellSelectionStyleNone;; 

cell.accessoryType = UITableViewCellAccessoryNone; 


[[cell textLabel] setFont:[UIFont fontWithName:@"Verdana" size:10]]; 

cell.textColor = [UIColor whiteColor]; 

cell.text = textfield.text; //Yourtextfield text 


return cell; 

}

相關問題