The cell in UITableView selects the relevant action:
To set up cell correlation in TableView:
@property (nonatomic) BOOL allowsselection Ns_available_ios (3_0); // default is YES. Controls whether rows can selectedwhen not in editing mode @property (nonatomic) BOOL allowsmultipleselection Ns_av Ailable_ios (5_0); // default is NO. Controls whether multiple rows can be selected simultaneously
[TableView Deselectrowatindexpath:indexpath Animated:yes]; Known Indexpath changes are selected
Cell itself Related:
[cell setuserinteractionenabled:<# (BOOL) #>]; // user interaction for cell [Cell setselected:<# (BOOL) #> animated:<# (BOOL) #>]; [Cell Setselectionstyle:<# (Uitableviewcellselectionstyle) #>];
Uitableviewcellselectionstyle:
Uitableviewcellselectionstylenone; Cannot click
Uitableviewcellselectionstyleblue; Click Yes Blue
Uitableviewcellselectionstylegray; Click Yes Gray
Personally, if the cell itself cannot be selected, set the cell's selected state to Uitableviewcellselectionstylenone or setuserinteractionenabled directly at the time of filling: NO
。
However, if there is a custom button in the cell, you will never be able to turn off user interaction. Just as ImageView turns off user interaction by default. (ImageView the user interaction is turned off by default, adding a button in ImageView is not appropriate)
Centralized selection-related properties for IOS UITableViewCell