美文网首页SO 问题来了
scrollview 上添加tableview , table

scrollview 上添加tableview , table

作者: 失忆的程序员 | 来源:发表于2017-02-13 18:05 被阅读159次

    //<UIGestureRcognizerDelegate> 需要实现

    //添加手势

    - (void)viewDidLoad {

    [super viewDidLoad];

    UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:selfaction:@selector(touch)];

    tapGes.delegate =self;

    [self.view addGestureRecognizer:tapGes];

    }

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {

    if([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {

    returnNO;

    }

    returnYES;

    }

    #pragma mark -添加手势

    - (void)touch {

    [self.view endEditing:YES];

    }

    相关文章

      网友评论

        本文标题: scrollview 上添加tableview , table

        本文链接:https://www.haomeiwen.com/subject/ltjtwttx.html