简体   繁体   中英

UITableView click not calling didselectrowAtIndexpath (last cell not clickable in ipad)ios Xcode 6.2

In my project,i have a scrollView--> view--> and i have the following elements inside this view(i named it my mainView). 1.mpmovieplayer 2.view(with two labels) 2.UITableView

I went through many answers mentioned in stackoverflow but they are not working for me.Can someone help me fix this issue? How to set the mainview height and the UIScrollView contentsize properly?The last two rows of the tableview are not clickable in iPad.It is working perfectly in iPhone.

Is this an autolayout issue?Thanks in advance.

this is my code in viewDidAppear:

float sizeOfContent = 0;
int i;
for (i = 0; i < [_scrollView.subviews count]; i++) {
    UIView *view =[_scrollView.subviews objectAtIndex:i];
    sizeOfContent += view.frame.size.height;
}

// Set content size for scroll view

_scrollView.contentSize = CGSizeMake(_scrollView.frame.size.width, sizeOfContent);

what should be my mainview frame?The last three cells are not clickable.Anybody face any similar issue?

Any suggestions are appreciated....

First I would check whether there is a view on top of this two cells or not.

  • use Xcdoe -> Debug -> View Debugging -> Capture View Hierarchy/ Show Frames. It sounds like a misslayouted view which catches the touch event but I could be wrong.

Are there any broken constraints in your xcode debug console?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM