gpt4 book ai didi

ios - 单击 uitableviewcell 时显示更多行

转载 作者:行者123 更新时间:2023-11-30 14:19:43 25 4
gpt4 key购买 nike

单击单元格时是否可以打开更多行?

例如,我们有一个带有国家/地区名称的表格 View 。当我单击它时,该县的所有城市都会显示在该单元格下方。

最佳答案

正如 A-Live 所说,您应该更改数据源,使其包含该国家/地区下方的城市。然后你可以打电话

tableView.reloadData()

或者,最好是,

tableView.insertRowsAtIndexPaths(_ indexPaths: [AnyObject],
withRowAnimation animation: UITableViewRowAnimation)

最后一个将执行在国家/地区行下方插入项目的动画。

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/insertRowsAtIndexPaths:withRowAnimation :

关于ios - 单击 uitableviewcell 时显示更多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30625047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com