iOS Development daily Error accumulation

Source: Internet
Author: User

1, iOS7 Tableviewcell Add a View,view above with a button, click the button does not perform a button click event

Workaround:

self.view.userInteractionEnabled = YES;

[Cell.contentview AddSubview:self.view]

The main problem is that the height of the cell is not as high as the view ability, so the view is not completely on the cell, so the Click event cannot be performed.



2, iOS7 Tableviewcell above has button, but button's click Effect is not, only long press can appear background picture

Workaround: Turn http://blog.csdn.net/zs449350247/article/details/21606973

One. The container of the IOS6 UITableViewCell Child View (subviews) is Uitableviewcellcontentview

the container for the UITableViewCell Child View (subviews) of the IOS7 is uitableviewcellscrollview

Since the IOS7 has been added to the action of the Edit button after sliding, so use ScrollView to handle ,uitableviewcellscrollview has the corresponding processing of the touch, Causes the button's click Effect to be masked, but the Click event is still in, so you can

1. Set the TableView. Delayscontenttouches = NO;
2. At the same time (uitableviewcell *) TableView: (uitableview *) TableView Cellforrowatindexpath: ( Nsindexpath*) Indexpath Proxy method Set the delay touch to No in ScrollView

for (ID obj in cell.) subviews)

{

if ([nsstringfromclass([obj class])isequaltostring:@ "Uitableviewcellscrollview"])

{

uiscrollview *scroll = (uiscrollview *) obj;

Scroll. delayscontenttouches =NO;

break;

}

}


;


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.