2011-02-21 3 views
1

hii 얘들 아, 두 개의 이미지 뷰를 view.each에 배치하고 뷰의 왼쪽과 오른쪽에 imageView를 배치하는 프로젝트를 개발 중입니다. 각 imageView는 image1과 image2.와 같은 두 개의 이미지를 포함하며 두 뷰를 병합하고 성공했습니다. 이미지 1은 병합 후 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]; 그리고 작동했습니다

모든 사람들

관련 문제