- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath根据你记住的按钮返回相应的类型啊。UITableViewCellEditingStyleDelete或者UITableViewCellEditingStyleInsert。
根据tag值进行获取,在这里设置tag值, 然后在方法 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 中进行获取这个tag值,获取方法是: UIButton *exitBtn = (UIButton *)[cell viewWithTag:1]//1是我上面设置的tag值 这样就获取到了,你再给他添加action事件就可以了,UITableViewController.view附一个UIView然后把你的UIButton add到UIView上 再把你的UITableVew也add到UIView上 我试过加UISearchBar可以这么做 UISearchBar一直置顶无论下面的UITableView怎么滚动欢迎分享,转载请注明来源:内存溢出
评论列表(0条)