Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS translation and scale animation
    primarykey
    data
    text
    <p>I'm working on UIButton animation where:</p> <p>The <code>UIButton</code> is set in the bottom center of the screen and scaled to a small size</p> <pre><code>_menuBtn.transform = CGAffineTransformMakeScale(0.1f, 0.1f); </code></pre> <p>When the app starts it should be moving to the bottom left side of the screen as it scales or grow to its original size.</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; _menuBtn.frame = CGRectMake(160, 513, 30, 30); _menuBtn.superview.frame = CGRectMake(160, 513, 30, 30); _menuBtn.transform = CGAffineTransformMakeScale(0.1f, 0.1f); NSLog(@"_menuBtn: %@ ; _menuBtn.superview: %@", _menuBtn, _menuBtn.superview); [UIView beginAnimations:nil context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.0f, 1.0f); CGAffineTransform lefttorightTrans = CGAffineTransformMakeTranslation(-200.0f,0.0f); _menuBtn.transform = CGAffineTransformConcat(scaleTrans, lefttorightTrans); [UIView commitAnimations]; } </code></pre> <p><strong>problem</strong></p> <p>When the animation starts the button starts moving from the bottom right side of the screen and not in the bottom center where it is and should be. Any help ?</p> <p><strong>Log Result</strong></p> <pre><code>NSLog(@"%@", _myBtn); 2013-08-14 09:22:38.913 GJCoolNavi[339:c07] &lt;UIButton: 0x813ea30; frame = (0 0; 0 0); opaque = NO; autoresize = TM+BM; layer = &lt;CALayer: 0x813eaf0&gt;&gt; </code></pre> <p>thats before doing the animation...and the result after the animation is:</p> <pre><code>2013-08-14 09:30:25.719 GJCoolNavi[612:c07] &lt;UIButton: 0x71206d0; frame = (160 294; 0 0); opaque = NO; autoresize = TM+BM; animations = { transform=&lt;CABasicAnimation: 0x7536a80&gt;; position=&lt;CABasicAnimation: 0x7537dd0&gt;; }; layer = &lt;CALayer: 0x7120790&gt;&gt; </code></pre>
    singulars
    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