ios6 - iOS animation: Drop down that keeps it position -


i´m trying create drop down menu display set of controls. got animation working whole "button" moves animation.

my button uiview named settingspanel, code far:

[uiview animatewithduration:1.0f animations:^{         self.settingspanel.bounds = cgrectmake(self.settingspanel.bounds.origin.x, self.settingspanel.bounds.origin.y, self.settingspanel.bounds.size.width, self.settingspanel.bounds.size.height + 300); }]; 

i want height of panel change, , does, whole view moves bit well.

how can create animation justs increases height downwards?

you need set frame, not bounds.

[uiview animatewithduration:1.0f animations:^{     self.settingspanel.frame =          cgrectmake(self.settingspanel.frame.origin.x,                     self.settingspanel.frame.origin.y,                     self.settingspanel.frame.size.width,                      self.settingspanel.frame.size.height + 300); }]; 

frame external coordinate. when change frame, change actual position of view within superview, can keep origin , width same , increase height.

bounds internal coordinate. when change bounds, system has decide frame; solution change happens around stationary center position. top moves upward height grows downward.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -