Fade no Curl.

Discussion in 'iOS Programming' started by IDMah, Sep 3, 2012.

  1. macrumors regular

    Joined:
    May 13, 2011
    #1
    Hi all.. approaching the home stretch.. but think I'm getting dumber..

    trying to CurlDown an overlay.

    with this.


    Code:
    -(void) showInfoScreen
    {
        // Creates the info / Setting screen //
        // turn off timer //
        [self timerControl:PAUSETIMER];
       
        // UIView *infoView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,640)];
        //UIView *mainViewOverlay = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,640)];
       
        UIImageView *popupView =[[UIImageView alloc] initWithFrame:CGRectMake(48.5,55.5,240,370)];   
       
        if (!overlayHelpScreen) {
            overlayHelpScreen = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,640)];   
            [overlayHelpScreen setBackgroundColor:[UIColor clearColor]];
        }
        /*
        UIGraphicsBeginImageContext(self.window.frame.size);
        [[UIImage imageNamed:@"Scroll-paper_2.png"] drawInRect:self.window.bounds];
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        */
        [popupView setImage:[UIImage imageNamed:@"Scroll-paper_2.png"]];
        [popupView setAlpha:0.0];
        popupView.tag   = 501;
        //[overlayHelpScreen setAlpha:0.0];
        // animate the View on //
        [overlayHelpScreen addSubview:popupView];
        
        //[[self window] addSubview:overlayHelpScreen];
       
       // [[self window] addSubview:infoView];
        [[self window] addSubview:overlayHelpScreen];
        [self setAnimationPageCurl:popupView];
    
       // [popupView release];
        
    }
    
    
    //  UIView *overlayHelpScreen  in  MYGameAppDelegate.h 
    
    - (void) setAnimationPageCurl:(UIImageView *)imageView {
        
        [UIView transitionWithView:imageView 
                          duration:1.5 
                           options: UIViewAnimationCurveEaseOut | UIViewAnimationOptionTransitionCurlUp 
                        animations:^ { imageView.alpha = 0.850; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:overlayHelpScreen cache:YES]; //<----- just guessing here } 
                        completion:nil];
    }
    
    so fade is fine. NO Curl action. 
    
    thanks
    Ian
    
    So much for me thinking I understand blocks. :confused:
    
    
    
    
     
  2. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    You give your block the curlUp, and inside the executable code of your block, you set it to curldown..
    I guess it's mega cofnused ;) have you tried removing the curlDown, and just letting it curl down at the options? :)
     
  3. thread starter macrumors regular

    Joined:
    May 13, 2011
    #3
    tired :

    Code:
        [UIView transitionWithView:imageView 
                          duration:1.5 
                           options: UIViewAnimationOptionTransitionFlipFromLeft  
                        animations:^ { imageView.alpha = 0.850;// [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:overlayHelpScreen cache:YES];
                        } 
                        completion:nil];
    
    
    Still no curl - or flipping love..

    thanks
    Ian
     
  4. macrumors regular

    Joined:
    Sep 16, 2011
    #4
    You misspelled it.


    Use this instead:
     
  5. thread starter macrumors regular

    Joined:
    May 13, 2011
    #5
    thanks for catching that but did nothing..

    I added a remove curlUp, using this:

    Code:
    -(void)removeOverlay
    {
     [[[self window] viewWithTag:216] setAlpha:BASEINFOALPHA];
        [self setAnimationPageCurlAway:[[self window] viewWithTag:216]];
    }
    
    -(void) setAnimationPageCurlAway:(UIView *)imageView
         {
             [UIView transitionWithView:imageView 
                               duration:0.5 
                                options: UIViewAnimationOptionCurveEaseOut|
                             UIViewAnimationOptionTransitionCurlUp 
                             animations:^ { imageView.alpha = 0.0;} 
                             completion:^(BOOL finished){[self removeInfoScreens];} ];
         }
    

    almost identical code to the CurlDown works perfectly.. flummoxed !!!

    I did Try calling:
    Code:
    [self setAnimationPageCurl:[[self window] viewWithTag:216]];
    the same way but nada!!
    I'm going with a fade in !!! UGH! !!!

    thanks
    Ian
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    You should be running transitionWithView: on a container view (as described in the documentation) and not on the imageView itself. You should probably review the "Animations > Changing the Subviews of a View" section of the View Programming Guide for iOS.
     

Share This Page