2011-02-21 29 views
1

hii guys、 私は2つのimagesViewsをview.each上に配置し、ビューの左右にimageViewを配置しています。各imageViewにはimage1とimage2のような2つのイメージが含まれています。両方のビューをマージして成功しました。マージ後、image1はimage2の下にあります。画像をマージするときに画像を上に移動する必要があります

私の要件は、画像2は、事前に

TNXこの点で私を助けて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

機能sendSubViewToBack

[self.view sendSubViewToBack:self.imageMagnet]; それは働いた

すべての人

関連する問題