size of view not changing after frame change
- by MikeNelson
I have managed to do pretty complex things on iPhone but I am always stuck with views, frames, bounds, and simple stuff that defies any logic and don't work as expected.
I have a self.view in my code and it has a lot of subviews on it.
At some point of the code, I need to reduce the frame vertically to a specific size and later put it back as before.
Then I have this code:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.5];
// frame is changing to a newHeight (other parameters are the same as before)
self.view.frame = CGRectMake (0, 0, originalWidth, newHeight);
[UIView commitAnimations];
The result is simply, nothing. The view continues as before. The same size, the same position. No change.
Why this kind of thing happens? how to solve that?