这是我的代码:
-(void)moveTheImage
{
for (NSUInteger i = 0; i < [views count]; 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;
}
}
}
我的问题是“imageView.alpha = 0.5”不起作用。我不知道为什么?