当用户向下滚动时,UIButton不起作用

时间:2011-01-24 11:51:46

标签: iphone uitableview uiview uiscrollview uibutton

我是意大利人,很抱歉我的英语不好!

所以...我有一个UITableView,每个单元格都用这段代码打开一个xib文件:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
    if (indexPath.row == 0){
                 detail = [[name_class alloc] initWithNibName:@"name_xib" bundle:[NSBundle mainBundle]];
                 detail.navigationItem.title = @"Title";}
  //then the others indexPath.row with the others xib

然后

[self.navigationController pushViewController:detail animated:YES];
[detail release];
detail = nil;

每个xib都有他的.m和.h文件。 每个xib都有这种结构:UIScrollView - > UIView - >的UITextView /的UIImageView / UIButton的

当我的UIButton的Y> 460(因此用户必须向下滚动才能看到它)时,uibutton“工作且不起作用”! 有时uibutton工作,但只有你触摸某个区域,而不是在所有的uibutton区域! 其他时候uibutton不起作用,触摸它是不可能的(或者更好,如果你触摸它什么都没发生!)

我确信只有当uibuttons“向下”时才会发生这种情况(Y> 460)。 我已经在模拟器和设备中尝试过了!

不荒谬吗? O_O

谢谢! :)

1 个答案:

答案 0 :(得分:1)

我认为你应该发布你的滚动视图代码以便更好地理解你在scrollview中遇到问题,我还没有看到你的代码所以我不确定这个但是你可能忘记增加 contentView大小的scrollview 那就是你面对你的问题。 只要看看你是否有足够的内容视图大小设置但仍然不能正常工作,那么在这里添加你的代码,以获得更好的答案。

相关问题