- 浏览: 2560817 次
- 性别:
- 来自: 苏州
-
文章分类
最新评论
-
jsntghf:
peio 写道这个怎么运行?Ruby On Rails的环境搭 ...
多文件上传之uploadify -
peio:
这个怎么运行?
多文件上传之uploadify -
往事如烟1:
我的项目是自己init了一个原始的project,之后将ver ...
React Native热部署之CodePush -
jsntghf:
往事如烟1 写道我按照你的说明进行,发现app退出之后,在进入 ...
React Native热部署之CodePush -
往事如烟1:
我按照你的说明进行,发现app退出之后,在进入不正确,请问是什 ...
React Native热部署之CodePush
ZKRevealingTableViewController.h
#import <UIKit/UIKit.h> #import "ZKRevealingTableViewCell.h" @interface ZKRevealingTableViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource, ZKRevealingTableViewCellDelegate> @property (nonatomic, retain) ZKRevealingTableViewCell *currentlyRevealedCell; @end
ZKRevealingTableViewController.m
#import "ZKRevealingTableViewController.h" #import <QuartzCore/QuartzCore.h> @interface ZKRevealingTableViewController () { ZKRevealingTableViewCell *_currentlyRevealedCell; } @property (nonatomic, retain) NSArray *objects; @end @implementation ZKRevealingTableViewController @synthesize objects; @dynamic currentlyRevealedCell; - (void)viewDidLoad { [super viewDidLoad]; self.objects = [NSArray arrayWithObjects:@"Right", @"Left", @"Both", @"None", nil]; self.tableView = (UITableView *)self.view; self.tableView.rowHeight = 52.0f; self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; } #pragma mark - Accessors - (ZKRevealingTableViewCell *)currentlyRevealedCell { return _currentlyRevealedCell; } - (void)setCurrentlyRevealedCell:(ZKRevealingTableViewCell *)currentlyRevealedCell { if (_currentlyRevealedCell == currentlyRevealedCell) return; [_currentlyRevealedCell setRevealing:NO]; if (_currentlyRevealedCell) [_currentlyRevealedCell autorelease]; [self willChangeValueForKey:@"currentlyRevealedCell"]; _currentlyRevealedCell = [currentlyRevealedCell retain]; [self didChangeValueForKey:@"currentlyRevealedCell"]; } #pragma mark - ZKRevealingTableViewCellDelegate - (BOOL)cellShouldReveal:(ZKRevealingTableViewCell *)cell { return YES; } - (void)cellDidReveal:(ZKRevealingTableViewCell *)cell { self.currentlyRevealedCell = cell; } - (void)cellDidBeginPan:(ZKRevealingTableViewCell *)cell { if (cell != self.currentlyRevealedCell) self.currentlyRevealedCell = nil; } #pragma mark - UIScrollViewDelegate - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { self.currentlyRevealedCell = nil; } #pragma mark - UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return (section == 0) ? @"Bounce" : @"No Bounce"; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.objects.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ZKRevealingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; if (!cell) { cell = [[[ZKRevealingTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"] autorelease]; cell.delegate = self; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.backView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; } cell.textLabel.text = [self.objects objectAtIndex:indexPath.row]; cell.direction = (ZKRevealingTableViewCellDirection)indexPath.row; cell.shouldBounce = (BOOL)!indexPath.section; return cell; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; if (row % 2 == 0) { cell.backgroundColor = [UIColor whiteColor]; } else { cell.backgroundColor = [UIColor colorWithRed:0.892 green:0.893 blue:0.892 alpha:1.0]; } cell.contentView.backgroundColor = cell.backgroundColor; } @end
效果图:
- ZKRevealingTableViewCell.zip (141 KB)
- 下载次数: 70
发表评论
-
Error watching file for changes: EMFILE
2016-12-15 11:57 1327执行npm start后报错: Error watc ... -
CocoaPods升级1.1.1报错
2016-12-15 08:39 811ERROR: While executing gem .. ... -
Visual Studio Code运行React Native报错
2016-06-13 09:43 1636React Native:0.27.2 React:15 ... -
React Native 0.27.2编译报错this._nativeModule.addListener is not a function
2016-06-12 15:21 3882React Native:0.27.2 React:15 ... -
Unable to resolve module ReactDefaultPerf from
2016-06-02 13:04 2803package.json信息如下: "reac ... -
React Native 0.26.2编译报错Undefined symbols for architecture x86_64
2016-05-26 11:15 2053React Native:0.26.2 React:15. ... -
Failed to update auto layout status: Failed to load designables from path (null)
2016-04-05 22:11 1746确保CocoaPods是0.36.1以上版本,然后在podf ... -
集成微信支付出现Undefined symbols for architecture x86_64错误
2016-03-21 13:22 1765Undefined symbols for architec ... -
React Native热部署之CodePush
2016-01-10 22:27 6279本文使用的环境是Mac OS 10.11.1、Xcode ... -
浅谈React Native中的FlexBox布局
2015-11-17 18:38 4321React Native通过一个基于FlexBox的布局引 ... -
React Native之构建一个简单的列表页
2015-10-23 14:45 2188本文中我们将创建一个简单的电影应用,这个应用将从Rotten ... -
React Native之环境搭建
2015-10-20 16:30 1465本文使用的环境是Mac O ... -
获取图片属性的方法
2015-10-18 20:43 3158很多时候我们需要获 ... -
NSCache的下标用法
2015-09-18 00:19 1235NSCache类和NSDictionary类很相似,也提供 ... -
如何给category添加属性
2015-08-16 10:41 710主要是使用了runtime中的associative机制。 ... -
UITableView的两种重用Cell方法的区别
2015-08-10 13:07 16178UITableView中有两种重用Cell的方法: - ... -
SDImageCache.m报错Unused variable 'fileName'
2015-08-04 21:56 1196GCC手册中的相关解释: unused:This att ... -
Swift调用Objective-C
2015-07-13 23:33 1247Swift调用Objective-C需要一个名为<工程 ... -
使用GCD实现倒计时
2015-07-24 21:47 1105__block int timeout = 60; // ... -
导航栏加分割线的实现
2015-07-01 22:00 1787self.view.backgroundColor = [U ...
相关推荐
在Storyboard中,可以通过拖拽UICollectionView对象到界面上并配置约束来创建。在代码中,可以使用以下代码创建: ```swift let collectionView = UICollectionView(frame: .zero, collectionViewLayout: ...
左右滑动动作 动作按钮具有:仅文本,文本+图片,仅图片 触觉反馈 可自定义的过渡:边框,拖动和显示 滑动期间可自定义的动作按钮行为 拖动超过阈值时的动画扩展 可定制的扩展动画 辅助功能 要求 Xcode 8 iOS 9.0...
例如,可以自定义导航栏的背景色、标题文字样式、左右按钮等。要实现自定义导航栏,你可以: 1. 使用`appearance`代理方法统一设置所有导航栏的样式。 2. 在每个ViewController中重写`navigationBar:didPopItem:`...
左右滑动动作 动作按钮具有:仅文本,文本+图片,仅图片 触觉反馈 可自定义的过渡:边框,拖动和显示 滑动期间可自定义的动作按钮行为 拖动超过阈值时的动画扩展 可定制的扩展动画 同时支持UITableView和...
UITableView是一个用于显示列表数据的控件,它的每个单元格(UITableViewCell)都可以自定义以展示不同的内容。默认情况下,UITableView并不直接支持滑动手势,但可以通过自定义实现。 为了添加滑动手势,我们通常...
例如,如果你有一个垂直布局,你可以为每个子视图设置顶部约束(相对于上一个子视图的底部),左右约束(相对于内容视图),以及固定高度。最后,内容视图的底部约束应设置为其最后一个子视图的底部,这样可以确保...
4. **拖动效果**:除了基本的滑动,MGSwipeTableCell还支持更复杂的拖动手势,用户可以通过拖动单元格来触发更多的交互,比如拖动排序,这在列表管理类应用中特别有用。 这个开源项目“MGSwipeTableCell-master”...
这种展开和收起效果可以利用UITableViewCell的子视图管理,通过隐藏或显示特定的视图来实现。此外,开发者可能还运用了UITableView的代理方法来跟踪单元格的状态变化,确保正确更新界面。 在项目中,...