objective c - Extending a view to the left side, animated -
I have a feeling that I want to extend the animation using the animation. All boundaries but the left should remain the same, so X position and the width of the scene are changing.
I use this code:
[UIView startAnimations: zero reference: zero]; [UIView Set Animation Duration: 5.0]; Self.frame = CGRectMake (self.frame.origin.x-100, self.frame.origin.y, self.frame.size.width + 100, self.frame.size.height); [UIView commitAnimations];
If I run this code, then the width of the scene is immediately set in the new value and then the view is taken to the new X point, but why? How can I change this behavior?
Thank you for your thoughts!
Your code is going well for me How are you running it? Calling - The set frame is the right choice for what you are doing. My custom view looks like this:
#import "TestView.h" @implementation TestView - (id) initWithFrame: (CGRect) frame {if ((self = [super initWithFrame: frame]) ) {// Initial Code} Healthy Return; } - (zero) Delok [[Super Delooc]]; } - go to (zero); {[UIView startup permissions: zero reference: zero]; [UIView Set Animation Duration: 5.0]; Self.frame = CGRectMake (self.frame.origin.x-100, self.frame.origin.y, self.frame.size.width + 100, self.frame.size.height); [UIView commitAnimations]; } @ And
I create an outlet from my visual controller type testview and connect it and set it in IB type. Then I make a button whose handler call [go custom]; Seems to work fine
Comments
Post a Comment