Note that there are some explanatory texts on larger screens.

plurals
  1. POUIView transition animation not showing subviews
    primarykey
    data
    text
    <p>I'm using a container view as a superview to two subviews. I want to "flip" one subview to another subview. The first subview happens to be blank and the second subview is a <code>UILabel</code> that has some text.</p> <p>The flip is happening but I do not see my subviews. </p> <p>I want to transition <code>blankLabelView</code> to <code>labelToTransition</code>. Any ideas? Thanks!</p> <p>The code:</p> <pre><code>-(void)viewDidLoad { CGRect labelFrame = CGRectMake(100.0, 217.0, 125.0, 34.0); self.labelContainerView = [[UIView alloc] initWithFrame:labelFrame]; // If I change the background color to something other than clear // I can see that this view is flipping, otherwise it appears that // nothing happens. self.labelContainerView.backgroundColor = [UIColor clearColor]; [self.someSuperview addSubview:self.labelContainerView]; UILabel *label = [[UILabel alloc] initWithFrame:labelFrame]; label.backgroundColor = [UIColor clearColor]; label.lineBreakMode = UILineBreakModeWordWrap; label.numberOfLines = 2; label.textAlignment = UITextAlignmentCenter; self.labelToTransition = label; UIView *blankView = [[UIView alloc] initWithFrame:labelFrame]; blankView.backgroundColor = [UIColor clearColor]; self.blankLabelView = blankView; } -(void)viewWillAppear { self.labelToTransition.text = @"some text from a model object"; [self.labelContainerView addSubview:self.blankLabelView]; } -(void)flipViewAnimation { UIView *containerView = self.labelContainerView; [UIView transitionWithView:containerView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromBottom animations:^{ [self.blankLabelView removeFromSuperview]; [containerView addSubview:self.labelToTransition]; } completion:NULL]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload