Flip animation with transparent background

705 views Asked by At

I am using the standard flip code to move from one view controller to another like this:

    tcvc = [self.storyboard instantiateViewControllerWithIdentifier:@"SB_TrebleClefStaffViewController"];

    [tcvc.view setFrame:CGRectMake(0, 0, 0, 0)];
    [UIView transitionWithView:staffContainer
                      duration:1
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    animations:^ { [staffContainer addSubview:tcvc.view ]; }
                    completion:nil];

This works but I can see the background of the view controller and I only want to see the content of the view controller flip with the background being transparent. I have set the staffContainer and tcvc alpha to 0 but the background is still there. Any help would be greatly appreciated.

Update***

Screenshot: the dark background is added when the staffContainer is being flipped, once it is in position the background is transparent. The main background of the whole app is white.

Can't post image directly so here is a link to a screenshot.

http://postimg.org/image/dtey0ajhf/

1

There are 1 answers

0
Eduard On

I was having the same issue with a single view (Not a view controller).

I solved it by editing the following properties via the Interface Builder (programmatically should work as well):

  • setting the background of the view to Clear Color and
  • setting the view to non opaque

I did not try it but I beleive setting the view of the VC should work.