ios 自定義tableviewcell
阿新 • • 發佈:2019-02-14
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCellIdentifier"; MyCell *cell = (MyCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"mycell" owner:self options:nil]; cell = [array objectAtIndex:0]; [cell setSelectionStyle:UITableViewCellSelectionStyleGray]; } [[cell lable] setText:@"31"]; [[cell lable1] setText:@"Raul"]; [[cell myImage] setImage:[UIImage imageNamed:@"3316.jpg"]]; return cell; }