[ios] UITableVIew单选效果
2013-03-22 10:37
405 查看
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int newRow=[indexPath row];
int oldRow;
if(self.lastPath==nil)
{
oldRow=-1;
}else {
oldRow=[self.lastPath row];
}
if(newRow!=oldRow)
{
[tableView cellForRowAtIndexPath:indexPath].accessoryType=UITableViewCellAccessoryCheckmark;
[tableView cellForRowAtIndexPath:self.lastPath].accessoryType=UITableViewCellAccessoryNone;
self.lastPath=[indexPath copy];
}
}
{
int newRow=[indexPath row];
int oldRow;
if(self.lastPath==nil)
{
oldRow=-1;
}else {
oldRow=[self.lastPath row];
}
if(newRow!=oldRow)
{
[tableView cellForRowAtIndexPath:indexPath].accessoryType=UITableViewCellAccessoryCheckmark;
[tableView cellForRowAtIndexPath:self.lastPath].accessoryType=UITableViewCellAccessoryNone;
self.lastPath=[indexPath copy];
}
}
相关文章推荐
- iOS如何利用UITableView实现单选效果
- [ios] UITableVIew单选效果
- ios UITableview头部图片弹簧效果
- IOS 之 UITableView 实现点击展开裂缝效果
- iOS UITableView取消SectionView停滞效果
- iOS UITableView 取消弹性效果
- iOS 瀑布流效果(模仿UITableView重用机制)
- IOS UITableview sectionHead 取消停滞效果
- IOS-使用UiTableview模仿UICollectionView的效果
- [iOS]实现UITableView头部带有图片并且下拉图片放大效果
- Android之PinnedHeaderExpandableListView- 仿ios的UITableView的header置顶效果
- [iOS开发必备工具之]UITableView下拉刷新效果
- 【iOS】UITableView Cell自定义单选功能
- ios TableView那些事(三十 五)TableView 单选操作使用Autolayout实现UITableView的Cell动态布局和高度动态改变
- iOS中UITableview实现跨区域拖动效果的实现
- IOS学习之UiTableView下拉刷新与自动加载更多,百年不变的效果(五)
- iOSUITableView头部带有图片并且下拉图片放大效果
- iOS - UITableView 单选功能实现
- IOS开发之UITableView小效果(禁止弹性效果)
- iOS学习 UITableView 单选