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
Post a Comment