如何在 iOS 中创建这种类型的 tableview??
在这里,如果我们点击第一行帐户",它会自动滚动显示在图像中的更多行.如果我们再次点击帐户",则该视图将被隐藏.
Here, If we tap on 1st row 'Account', then automatically it scrolled with some more rows which is showing in Image. And if again we tap on Account, then that view will be hidden.
推荐答案您可以将帐户作为一个单元格,在点击时展开以显示三个按钮(个人资料"、激活帐户"、更改密码"),但是产生了一个问题:点击三个按钮中的每一个都将计为用户选择了帐户单元格"并触发 -tableView:didSelectRowAtIndexPath: 并导致单元格的展开/折叠.
You could have Account as a cell that expands on tap to reveal three buttons ("Profile", "Activate Account", "Change Password"), but that creates a problem: tapping around each of the three buttons will count as "user selected the Account cell" and trigger -tableView:didSelectRowAtIndexPath: with the resulting expand/collapse of the cell.
或者您可以将每个隐藏选项(配置文件"、激活帐户"、更改密码")设为单独的表格视图单元格.但我不知道如何为三个单元格制作动画整体扩展和收缩(而不是每个单元格分别从零高度扩展到完全扩展).
Or you could make each of the hidden options ("Profile", "Activate Account", "Change Password") a separate table view cell. But I don't know how you could animate the three cells as a whole expanding and contracting (instead of each expanding separately from zero height to fully expanded).
因此,也许最好的解决方案是:
这不是 UITableView 最优雅的用法,但可以完成工作.
It is not the most elegant use of UITableView, but will get the job done.
更多推荐
iOS 中 UITableView 中的下拉列表
发布评论