UITableViewCell outside of UITableView

后端 未结 3 1861
粉色の甜心
粉色の甜心 2020-12-31 08:28

I notice that InterfaceBuilder has UITableViewCell in its library of objects I can drag onto a view. I wonder if it ever makes sense to use one outside of a

3条回答
  •  盖世英雄少女心
    2020-12-31 09:03

    Best to substitute the UITableViewCell with a UIView if you want to use it outside of table view... you can try to fake the disclousure indicator by drawing it yourself, or using an icon

    If you want to reuse the code, you can put the login in a custom UIView subclass, which is used both in the cell and also in the regular UI

    I would discourage using UITableViewCell outside of UItableView as tempting it may be... the cell conforms to reuse handling and layout resolutions, so while it may look fine, it is a misuse which can trigger unforeseen problems

提交回复
热议问题