A button in a custom cell does not respond to a click event

Source: Internet
Author: User

Using xib to customize a cell (Xib drag directly in the Uiview,uiview to add the button), in the xcode6.4 when the operation is not a problem, but the xcode7 found that the button can not be clicked. When the Xcode7 is running, it responds to the Didselectedrow method of the cell. Solution, the Xib custom cell in the UIView changed to UITableViewCell, add UIButton to the cell contentview inside there is no problem. If the custom cell is too much, there can be a simple way to move the cell's contentview to the innermost layer, or delete the Contentview directly.

The specific reason: Before Xcode7, the custom UIView was added to Contentview's subviews. But after the Xcode7, the UIView is added to the inside of the Contentview layer, the cell's outermost layer is contentview, so when clicked, is actually clicked Contentview instead of button.

A button in a custom cell does not respond to a click event

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.