我的要求是image2应该高于image1.can任何人都可以在这方面帮助我
提前预订
- (void) _playIntro
{
_playing = YES;
//merge halfway between the two magnets
CGRect mergeFrame = kFunny123MagnetBoundsIntroIpad;
mergeFrame.origin.x = (self.imageMagnet.frame.origin.x + self.glyphMagnet.frame.origin.x)/2;
mergeFrame.origin.y = (self.imageMagnet.frame.origin.y + self.glyphMagnet.frame.origin.y)/2;
[_imageMagnet mergeWithMagnet:_glyphMagnet atFinalFrame:mergeFrame withDuration:kMagnetMergeDuration];
//[_glyphMagnet mergeWithMagnet:_imageMagnet atFinalFrame:mergeFrame withDuration:kMagnetMergeDuration];
[self performSelector:@selector(_introFinished) withObject:nil afterDelay:kMagnetMergeDuration + kAfterMagnetMergedDuration];
}
- (void) mergeWithMagnet:(Funny123MagnetView *)otherMagnet atFinalFrame:(CGRect)frame
withDuration:(float)duration
{
[UIView beginAnimations:@"merge" context:nil];
[UIView setAnimationDuration:duration];
BOOL showsTopImage;
[self setFrame:[otherMagnet.superview convertRect:frame toView:self.superview]];
[otherMagnet setFrame:frame];
[UIView commitAnimations];
[UIView beginAnimations:@"mergeFinalize" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelay:duration];
if (!showsTopImage)
{
[[otherMagnet _bottomImage] setAlpha:0];
[[self _bottomImage] setAlpha:1];
//[[otherMagnet _topImage] setAlpha:1];
//[[self _topImage] setAlpha:0];
}
else {
[[otherMagnet _topImage] setAlpha:1];
[[self _topImage] setAlpha:0];
//[[otherMagnet _bottomImage] setAlpha:0];
//[[self _bottomImage] setAlpha:1];
}
[UIView commitAnimations];
}
_glyphImageView和_objectImageView是imageViews
答案 0 :(得分:0)
我使用了sendSubViewToBack函数
[self.view sendSubViewToBack:self.imageMagnet]; 它工作了
你们所有人