How do I select a UITableViewCell by default?

前端 未结 7 2087
忘了有多久
忘了有多久 2020-12-17 10:50

I have created a UITableView and would like a specific UITableViewCell to appear selected (blue) when the view is loaded.

7条回答
  •  醉梦人生
    2020-12-17 11:05

    Be judicious using this method, as selecting the row in this way is something Apple suggests against doing to show a "chosen" state.

    Instead, consider setting the cell's accessoryType property to something like UITableViewCellAccessoryCheckmark.

提交回复
热议问题