新人求助,关于table view的这种蓝色的勾怎么做 新人求助,关于table view的这种蓝色的勾怎么做 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Cell上面添加一个图片 自定义一个cell,里面可以加上自己想要的button,给button添加图片 节省内存开销就CALayer //选中行- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryCheck;} 提供2种思路。第一种,自定义cell,上面放一张图片。第二种,使用系统的。代码如下:-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ for (UITableViewCell *cell1 in [self.tableView visibleCells]) { cell1.accessoryType = UITableViewCellAccessoryNone; //遍历所有cell,Type置为空,这个很重要 } UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; cell.accessoryType = UITableViewCellAccessoryCheck;} //选中行 for (UITableViewCell *cell1 in [self.tableView visibleCells]) { cell1.accessoryType = UITableViewCellAccessoryNone; //遍历所有cell,Type置为空,这个很重要 } 如果是需要系统样式的对勾可以通过设置 cell 的accessoryType 来实现如果需要自定义的样式,可以通过自定义一个UITableViewCell 。并重写cell的- (void)setSelected:(BOOL)selected animated:(BOOL)animated { }来实现 cell.accessoryType = UITableViewCellAccessoryCheck; 如何设置 imageview 平移动画循环 一个有关IOS很简单的问题!!!!! 怎么正确安装Xcode4.4.1?以及4.4.1版本的卸载方法,急!急? ios客户端与服务器间的数据交互 听说华为开发者联盟在官方微信上举办配对联活动,要怎么参加呢? VLC ------iOS中使用播放器 我用的NSUserDeafaul存东西报错~~~ 说我类型不对~ 求大神~ 多个微信安装 iOS开发信鸽推送 获取不到服务器推送内容 先谢谢大家帮忙 用webview加载pdf iOS 10.1.1不支持pdf1.2版本 初学ios 怎么吧 协议当作 参数传入函数呢 ios 多线程多任务并发下载图片资源
//选中行
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheck;
}
第一种,自定义cell,上面放一张图片。
第二种,使用系统的。代码如下:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
for (UITableViewCell *cell1 in [self.tableView visibleCells])
{
cell1.accessoryType = UITableViewCellAccessoryNone; //遍历所有cell,Type置为空,这个很重要
}
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheck;
}
for (UITableViewCell *cell1 in [self.tableView visibleCells])
{
cell1.accessoryType = UITableViewCellAccessoryNone; //遍历所有cell,Type置为空,这个很重要
}
如果需要自定义的样式,可以通过自定义一个UITableViewCell 。并重写cell的
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { }
来实现