Centralized selection-related properties for IOS UITableViewCell

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.