思路:在UIScrollView中设置手势监听。通过找到手势的位置确定是否点击了Button
1、为UIScrollView设置手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bootButtonAction:)];
[pageScrollView addGestureRecognizer:tap];
2、对比点击的位置是否在Button范围内
-(void) bootButtonAction:(UIGestureRecognizer *) sender{
//取得所点击的点的坐标
CGPoint point = [sender locationInView:self];
// 判断该点在不在区域内
if (CGRectContainsPoint(button.frame, point))
{
//操作
[self removeFromSuperview];
}
}