1、首先新建View
2、将Table View cell 控件拖入View
3、自定义Table View Cell 的identifier
4、设计自己的Table View Cell
5、在UItableView 方法中声明使用自己自定义的Cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier"; //CustomCellIdentifier 为自己自定义的cell identifier static BOOL nibsRegistered = NO; if (!nibsRegistered) { UINib *nib; if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad) { nib=[UINib nibWithNibName:@"UIDownLoadCell_ipad" bundle:nil]; }else{ nib=[UINib nibWithNibName:@"UIDownLoadCell_iphone" bundle:nil]; } [tableView registerNib:nib forCellReuseIdentifier:CustomCellIdentifier]; nibsRegistered = YES; } UIDownLoadCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier]; //分别设置自己在Cell 中添加的控件。 [cell.areaname setText:[self.areanames objectAtIndex:indexPath.row]]; [cell.progress setHidden:YES ]; NSString * url=[NSString stringWithFormat:@"%@%@",hostUrl,[self.downLoadUrl objectAtIndex:indexPath.row]]; cell.downloader=[[DWDownloader alloc]initWithPerpeties:url localFile:[self.downLoadUrl objectAtIndex:indexPath.row] threadCount:1]; [cell.downLoad addTarget:cell action:@selector(startDownLoad:) forControlEvents:UIControlEventTouchUpInside]; [self.allCells setObject:cell forKey:[self.downLoadUrl objectAtIndex:indexPath.row]]; if ([cell.areaname.text hasPrefix:@"浙江省"]&&[cell.areaname.text hasSuffix:@")"]) { [cell.downLoad setBackgroundImage:self.hasDownLoadImg forState:UIControlStateNormal]; [cell.downLoad setEnabled:NO]; }else if(![cell.areaname.text hasPrefix:@"浙江省"]&&[cell.areaname.text hasSuffix:@")"]){ [cell.downLoad setBackgroundImage:self.deleteImgImg forState:UIControlStateNormal]; } return cell; }
相关推荐
UITableViewCell自定义等高
自定义UITableViewCell。实现各种样式的表格输入界面ios源代码设计资料
IOS布局控件使用自定义UITableViewCell 欢迎界面后台获取功能等项目设计IOS源码合集: ios三级展开列表TQMultistageTableView_10802 ios个性化每个tableMHNibTableViewCell ios分页的滚动视图 IOS可扩展底部TablBar ...
iOS 自定义UITableViewCell,iOS 自定义表视图 博客地址:http://blog.csdn.net/yang8456211
ios7自定义UITableViewCell
ios项目源代码 各种布局控件使用及扩展视图自定义UITableViewCell等源码合集: DTCoreText-1.6.10在UITextView上实现十分丰富的文字效果 ios三级展开列表TQMultistageTableView_10802 ios个性化每个...
IOS源码——自定义UITableViewCell。实现各种样式的表格输入界面.7z
IOS源码——自定义UITableViewCell。实现各种样式的表格输入界面.zip
IOS开发UITableViewCell自定义那点事.pdf
全面解析iOS应用中自定义UITableViewCell的方法共19页.pdf.zip
IOS应用源码之自定义UITableViewCell。实现各种样式的表格输入界面.zip
iOS 自定义UITableViewCell上添加UIButton按钮点击实现,知道点击了是哪个cell上的按钮。用代理跟代码块两种方式实现。
iPhone开发使用Xib自定义UITableViewCell
在XCode12中实现自定义TableViewCell微博事例,包含图片资源及plist数据
主要介绍了iOS应用开发中自定义UITableViewCell的方法,示例为传统的Obejective-C语言,需要的朋友可以参考下
这个是同学项目需求,然后自己自定义了一个多选择的cell的东西了
通过自定义UITableViewCell实现ibooks的图书列表样式。
本篇文章主要介绍了ios中自定义cell,自定义UITableViewCell,非常具有实用价值,需要的朋友可以参考下。