views:

28

answers:

2

Hello! I am using the code:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.3];
[info setFrame:CGRectMake( 0, 96, 320, 384)];
[UIView commitAnimations];

to have an animation of the object "info" to change its heght to 384... Nothing else is changed, but the only way to do that is to change the whole frame, and in the animation, instead of the height growing, the object just snaps to the top of the screen with the proper width and height, and just moves downward into place, instead of staying in place and just simply growing. How can I fix it so it does just grow downward?

EDIT: The info is a UITextView, and the downward sweep only happens when you are not scrolled to the top.

A: 

Instead of [info setFrame:CGRectMake( 0, 96, 320, 384)]; try info.frame.size.height = 384

Gordon Fontenot
I cannot set info.frame.size.height because the .height attribute is read-only. "lvalue required as left operand of assignment"
Hankweb
A: 

Try this:

//... animation setup
CGRect frame = info.frame;
frame.size.height = 384;
info.frame = frame;
[UIView commitAnimations];
Jason Foreman
Still sweeps downward.
Hankweb