如何在uitableview中启用和禁用单元格 [英] How to enable and disable cells in uitableview

查看:80
本文介绍了如何在uitableview中启用和禁用单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我想在视图加载时在开始时禁用 UITableView 的单元格,按下按钮后,<应该启用code> UITableView 并且应该正常工作。

I have a project in which I want to disable the cells of a UITableView at the beginning when the view loads, and after pressing a button, the cells of the UITableView should be enabled and should work properly.

我该怎么做?

推荐答案

你可以使用
table.allowsSelection = NO;在viewwillappear方法中
,然后在按钮点击事件中设为YES。

You can use table.allowsSelection = NO; in your viewwillappear method and then make it YES onbutton click event.

这篇关于如何在uitableview中启用和禁用单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆