开发者

problem with uiimageView collision detection

here is my code:

-(void)moveTheImage
{
    for (NSUInteger i = 0; i < [views cou开发者_JAVA百科nt]; i++)
    {
        imageView = [views objectAtIndex:i];
        X = [[XArray objectAtIndex:i] floatValue];
        Y = [[YArray objectAtIndex:i] floatValue];
        imageView.center=CGPointMake(imageView.center.x + X, imageView.center.y + Y);
    }   

    if(!intersectFlag)
    {    
        if(CGRectIntersectsRect(imageView.frame,centre.frame))    
        {
            imageView.alpha=0.5;
            intersectFlag = YES;         

            ++count;
        }
    }
    else
    {
        if(!CGRectIntersectsRect(imageView.frame,centre.frame))
        {
            intersectFlag = NO;
        }
    }
}

My problem is that "imageView.alpha=0.5" doesn't work.I don't know why ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜