Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why is my view rotating 90 degrees prior to it scaling?
  2. - (void)buttonTapped:(UIButton *) sender
  3. {
  4.     NSInteger index = [self.carousel indexOfItemView:sender];
  5.  
  6.     UIView *currentView = [self.carousel itemViewAtIndex: index];
  7.     UIView *proxyView = [[UIView alloc] initWithFrame:currentView.frame];
  8.     proxyView.hidden = YES;
  9.     proxyView.autoresizingMask = currentView.autoresizingMask;
  10.     [currentView.superview addSubview: proxyView];
  11.  
  12.     CGRect frame = [currentView.window convertRect:currentView.frame fromView:proxyView.superview];
  13.     [currentView.window addSubview:currentView];
  14.     currentView.frame = frame;
  15.  
  16.     [UIView
  17.      animateWithDuration:2.4
  18.      animations:^{
  19.          currentView.frame = currentView.window.bounds;
  20.      }];
  21.        
  22. currentView.frame = frame;
  23.        
  24. currentView.frame = currentView.window.bounds;