简体   繁体   English

UITableView单击未调用didselectrowAtIndexpath(在ipad中不可单击的最后一个单元格)iOS Xcode 6.2

[英]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). 在我的项目中,我有一个scrollView->视图->并且此视图中有以下元素(我将其命名为mainView)。 1.mpmovieplayer 2.view(with two labels) 2.UITableView 1.mpmovieplayer 2.view(带有两个标签)2.UITableView

I went through many answers mentioned in stackoverflow but they are not working for me.Can someone help me fix this issue? 我经历了stackoverflow中提到的许多答案,但它们对我不起作用。有人可以帮助我解决此问题吗? 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. 如何正确设置主视图的高度和UIScrollView的contentsize?在iPad中无法单击表格视图的后两行,在iPhone中可以正常使用。

Is this an autolayout issue?Thanks in advance. 这是自动布局的问题吗?

this is my code in viewDidAppear: 这是我在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. 使用Xcdoe->调试->视图调试->捕获视图层次/显示框架。 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? 您的xcode调试控制台中是否有任何打破的约束?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UITableView仅在使用Xcode 5编译的iOS7上不调用didSelectRowAtIndexPath - UITableView not calling didSelectRowAtIndexPath on only iOS7 compiled with Xcode 5 使用UIButton自定义UITableView单元格不调用didSelectRowAtIndexPath - Custom UITableView Cell with UIButton not Calling didSelectRowAtIndexPath iOS-UITableView单元格,单击单元格内的UIImageView,但停止调用didSelectRowAtIndexPath - IOS - UITableView Cell, click on UIImageView inside cell but stop didSelectRowAtIndexPath being called iOS-具有自定义单元格的可单击UITableView - iOS - Clickable UITableView with Custom Cell 修改UITableView中didSelectRowAtIndexPath上的单元格 - Modify cell on didSelectRowAtIndexPath in UITableView iOS 8自动单元格高度 - didSelectRowAtIndexPath导致UItableview跳转到顶部 - iOS 8 Auto cell height - didSelectRowAtIndexPath causes UItableview to jump to top 使用Xcode 6.2在iPad 1(iOS 5.1.1)上测试应用 - Testing app on iPad 1 (iOS 5.1.1) using Xcode 6.2 锁定方向在 ipad ios 8 swift xcode 6.2 上不起作用 - locking orientation does not work on ipad ios 8 swift xcode 6.2 在UiTableView didSelectRowAtIndexPath更新错误的单元格 - In UiTableView didSelectRowAtIndexPath updating wrong Cell iOS Swift-UITableView didselectrowatindexpath崩溃 - iOS Swift - UITableView didselectrowatindexpath crashes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM