Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit test not working for cells in a second column + possible fix #209

Open
VirtualDiveGuide opened this issue Apr 10, 2014 · 0 comments
Open

Comments

@VirtualDiveGuide
Copy link

I couldn't get the following AQGridView function to return YES for cells in the second column of the grid when tapped:

  • (BOOL) _canSelectItemContainingHitView: (UIView *) hitView

I got it working by replacing:

 CGPoint hitCenter = [self convertPoint:[hitView center] fromView:hitView];

for ( AQGridViewCell *aCell in [[self visibleCells] copy])
{

    if ( CGRectContainsPoint( aCell.frame, hitCenter ) )
    return ( YES );

}

with:

UIView *parent = hitView.superview;
while (parent != nil)
{
    if ([parent isKindOfClass:[AQGridViewCell class]])
    {
        return ( YES );
    }
    parent = parent.superview;
}

This could possibly even be a bug with UIView's:

  • (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;

(hitCenter was outside the grid view but debugging the views in the hierarchy suggests this could not be the case.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant