- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- static BOOL nibsRegistered = NO;
- if (!nibsRegistered) {
- UINib *nib = [UINib nibWithNibName:@"CellView" bundle:nil];
- [tableView registerNib:nib forCellReuseIdentifier:@"CellView"];
- nibsRegistered = YES;
- }
- CellView *mycell=[tableView dequeueReusableCellWithIdentifier:@"CellView"];
- mycell.index_lb.text=[NSString stringWithFormat:@"%d", [indexPath row]];
- mycell.name_lb.text=[dataList objectAtIndex:[indexPath row]];
- //mycell.textLabel.text=@"nofeng";
- return mycell;
- }
cellview中的xib注册
最新推荐文章于 2018-05-09 09:43:14 发布