UITextView inside UIScrollView is not First Responder?

This is my . H file: import @interface Untitled1ViewController : UIViewController { UIScrollView *scrollView; UITextField *composeTextView; } @property (nonatomic,retain) IBOutlet UIScrollView *scrollView; @property (nonatomic,retain) IBOutlet UITextField *composeTextView; @end this is my . M file: import "Untitled1ViewController.

H" @implementation Untitled1ViewController @synthesize scrollView; @synthesize composeTextView; - (void)viewDidLoad { super viewDidLoad; scrollView setContentSize:CGSizeMake(540,620); composeTextView. Delegate = self; composeTextView becomeFirstResponder; } in IB, i've connected the following: textField to composeTextView scrollView to scrollView and the textField delegate to the file's owner Try again and advise.

This is my . H file: #import @interface Untitled1ViewController : UIViewController { UIScrollView *scrollView; UITextField *composeTextView; } @property (nonatomic,retain) IBOutlet UIScrollView *scrollView; @property (nonatomic,retain) IBOutlet UITextField *composeTextView; @end this is my . M file: #import "Untitled1ViewController.

H" @implementation Untitled1ViewController @synthesize scrollView; @synthesize composeTextView; - (void)viewDidLoad { super viewDidLoad; scrollView setContentSize:CGSizeMake(540,620); composeTextView. Delegate = self; composeTextView becomeFirstResponder; } in IB, i've connected the following: textField to composeTextView scrollView to scrollView and the textField delegate to the file's owner. Try again and advise.

Still no luck for me. Is your composeTextView inside of your scrollView? – Sheehan Alam May 19 '10 at 10:21 Also I'm using a UITextView and not a UITextField – Sheehan Alam May 19 '10 at 10:25 Thanks!

This code works great. I realized my UITextView was not hooked up in IB. Small mistake, causing huge headaches.

– Sheehan Alam May 19 '10 at 11:21.

I've done the same, added some code and it works OK: scrollView. ContentSize = CGSizeMake(540,620); scrollView. ShowsHorizontalScrollIndicator = NO; scrollView.

ShowsVerticalScrollIndicator = NO; scrollView. ScrollsToTop = NO; composeTextView becomeFirstResponder.

I added your code, and still no luck. Could it be IB? I have a UIView that contains a UIScrollView.

Inside of that is a UITextView and some UIButtons. All controls are connected in IB. – Sheehan Alam May 18 '10 at 19:34 I've done everything again, and from Scratch, i'll attach it as a new answer so I could mark the Code.

– Dror Sabbag May 18 '10 at 19:52.

The text view takes scroll events and hence the scroll events are not passed on further in its responder chain. If you are not interested in scrolling the text view, disable the scrolling in textView (use nib or scrollEnabled property), now, scrollView will start taking scroll events.

Even if I disable scrolling for the textview, it does not become the first responder – Sheehan Alam May 19 '10 at 10:17 It does, I have verified. I am quite sure about this. If you disable scrolling in the textView, then the container - scrollView will start taking the events.

– Raj May 19 '10 at 10:30 I have modified my code to composeTextView. ScrollEnabled = NO; and scrollView becomesFirstResponder; I have also tried the former code and composeTextView becomesFirstResponder with no luck. – Sheehan Alam May 19 '10 at 10:37 1 Ok I mistook your question, call -becomeFirstResponder on the textView should work.

Probably you have missed the outlet connections. Put a breakpoint in your -viewDidLoad method and see if the compositTextView / scrollView are nil. – Raj May 19 '10 at 10:58 My outlets were not setup for the textView in IB.

Thanks! – Sheehan Alam May 19 '10 at 11:07.

I have a UITextView added on my UIView. The textview added is not editable, it is just to display some data. The data displayed in the textview is dynamic.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions