views:

491

answers:

1

I have a UITextField inside a ScrollView that is supposed to be animated into a visible area above the popping keyboard when entering the textfield. So I used the delegates textFieldShouldBeginEditing-method to call the scrollviews setContentOffset.

now in the 2.2.1 Simulator this worked just fine, but in the 3.0 Simulator the scrollview resets the offset and on the device theres just some random-chaos happening with the scrollview.

I noticed that when I took out the setContentOffset, the textfield still tries to center itself (but somehow only on the x-axis). so I suppose that the 3.0-UITextField sets off some new animation with the old coordinates, right after the textFieldShouldBeginEditing is called. but I can't figure out how to disable it.

A: 

My solution was make the frame of scorll view a little bit larger than what you need. It seems like scroll view only auto center active fields near its frame edge.

Livan