Why a uitextfield inside a uiscroll view doesn't scroll?
I have a scrollview which contains a text field and a text view. I would that both two scrolled together. How can I do? Now only the text view scroll.
Precisely, I would that the title scrolls up while the user writes in the textview and, if the user decides to set it, he can scrolls up and refind the textfield.
IBOutlet UIScrollView *scrollView;
and connect it in the interface builder and in your .m file put this into your viewDidLoad
[scrollView setScrollEnabled:YES]; [scrollView setFrame:CGRectMake(0,55,320,180)]; [scrollView setContentSize:CGSizeMake(320,320)];
then put your textField and your textView inside the scroolView in the interface builder
I want to say one thing,
Here the textfield can have only one line and the textview has multi-line of data. So in your contest both will scroll, but you are saying one is scrolling and other is not.
In this what I am expecting is scrollview is not scrolling but the text view is showing its data(content).
If you want to check this, increase the textview frame upto its content and put userInteractionEnabled as NO and then set the scrollview content size to some what more than the textview size. Then you can observe both are scrolling.