uiTableView 单选效果

-(void)tableView:(UITableView *)tableView

didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

[tableView deselectRowAtIndexPath:indexPath

animated:YES];

NSArray* nsArryUITableViewCell=[tableView visibleCells];

//单选效果

for (UITableViewCell* uiTableViewCell in nsArryUITableViewCell)

{

if (uiTableViewCell.selected==YES)

{

uiTableViewCell.imageView.image=[UIImage imageNamed:@"dot_12"];

uiTableViewCell.selected=!uiTableViewCell.selected;

}

}

UITableViewCell* uiTableViewCell=[tableView cellForRowAtIndexPath:indexPath];

if (uiTableViewCell.selected)

{

uiTableViewCell.imageView.image=[UIImage imageNamed:@"dot_12"];

uiTableViewCell.selected=!uiTableViewCell.selected;

}

else

{

uiTableViewCell.imageView.image=[UIImage imageNamed:@"dot001_on"];

uiTableViewCell.selected=!uiTableViewCell.selected;

}

}

uiTableView 单选效果,布布扣,bubuko.com

时间: 2024-08-28 07:05:10

uiTableView 单选效果的相关文章

iOS开发-UITableView单选多选/复选实现1

TableView如何实现单选或者多选呢? 我们的直接思路是修改某一个Cell的样式即可, 那么修改样式需要通过修改对应的数据, 从这里可以推断我们需要给Cell对应的数据设置一个标志位, 当选中的时候来修改该标志位刷新那一行即可 如果是单选实现稍微复杂一些: 单选需要设置一个属性来保存上一次选中的行, 待选中新的行之后需要修改该行,不断维护 我的实现如下: (1)创建一个TableViewController, 为了简单使用系统的Cell样式 设置重用标识符为 ACELL cell对应的Mod

关于UITableView选中效果以及自定义cell上的控件响应事件

tableView默认的点击效果是:点击cell:A,出现点击效果,点另一个cell:B的时候,A的点击效果才会消失. 1.对于tableView,比较常用的效果,是点击表格行,出现效果,点击完毕,效果消失 那么就要在代码里做一些设置.代码如下: -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath

chckbox 实现单选效果(html)

note:在html <input> 标签类中的checkbox实现单选效果. 在最近的开发项目中,客户要求使用小方格子实现“单选”功能,显然圆点的radio被out了,只能选择chckbox的方块样式,也在网上搜过,可能有点儿脑残,没有找到. 废话不多说直接上代码: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv

uiTableView透明效果

//uiTableView透明效果 tableView.backgroundView=nil; tableView.backgroundColor=[UIColor clearColor]; uiTableViewCellPullDown.textLabel.backgroundColor=[UIColor clearColor]; uiTableViewCellPullDown.backgroundColor=[UIColor clearColor]; uiTableView透明效果

Gridview 单选效果实现,且用且珍惜

Gridview 单选效果,在androidapp中实现非常频繁,我这里提供我的一种思路,这是我的思维导图: 怎么样将这样的思维导图翻译成java代码了,请看下面的代码了: // 电子产品的图片列表信息 static class ConfigInfo { static final int[] img = { R.drawable.electron_dvdplay, R.drawable.electron_toudaishishexianji, R.drawable.electron_miniyi

简单实现ToolStripMenuItem(菜单栏)的单选效果

来源:http://www.97world.com/archives/2194 这几天在写又拍云的客户端,老实说确实学到了不少东西!接下来的几天我会把一些技巧或者原来没有接触过的一些东西发上来,算是复习吧! 之前想要弄ToolStripMenuItem的单选菜单效果,本来想着要用到不短的一段if判断来实现,百度了一下发现了一个蛮不错的方法,如果菜单栏目多的话更能体现高效率. 首先我们需要定义一个方法: 帮助 1 2 3 4 5 6 7 8 private void SingleCheck(obj

css实现单选效果,看看有趣的tabIndex

以前我实现单选变色几乎都是用js实现的,今天看到有个css属性可以直接实现单选变色,很开心啊~ 话不多说看效果 实现的代码如下 使用tabIndex还可以实现别的有趣的效果 话不多说看效果 实现的代码如下 原文地址:https://www.cnblogs.com/smart-girl/p/9176920.html

iOS——UITableView单选模式,多选模式,单选多选混合模式

70行代码量的UITableViewCell实现单选,多选,单选多选混合选择. SingleVC——50行 MultipleVC——55行 ChaosVC——80行 cell为Xib拓展性较好,可拿去直接使用. 代码量不是越少越好,还要容易阅读,这里突出代码量的意思仅仅是建立在简单易用的原则上,有不明白可以跟帖,有大神优化的话跪求恩赐. github: https://github.com/ZyZwei/iOS_SelectStyle.git coding: https://git.coding

UITableView拉伸效果

创建一个UITableView 和一个UIImageView @property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UIImageView *headerImgaeView; 初始化 1 - (void)viewDidLoad { 2 [super viewDidLoad]; 3 4 self.tableView = [[UITableView alloc] initWithFram