objective c - in iPhone App set focus on textView -


In my iPhone app I have both textField and TextView and I group them with scrollview

The problem now is that when I call

  [textField becomeBecomeFirstResponder];   

This sets the focus on textField in the scrollView and the content area appears in the scrollview

but when I do the same with UItextView:

  [be textView Be the first viewer];   

This text is not making textview visible in the scroll view, it does not focus on textview (cursor sets the text view but the content area of ​​the scrollview dose does not appear with manual scrolling. Happens)

How do I set the focus on textView and set the content area in the scrollview?

I believe your problem here is that UITextView is a UIScrollView, while UITextField is a UIControl is.

This is quite a possibility, although I have not tested this code at this time, this is the best way to handle it for viewing textView.isFirstResponder and when it is correct , Then call [scrollView scrollRectToVisible: textView.frame animated: yes] on your UIScrollView.

Comments