简体   繁体   中英

UITextView becomes first responder but the pointer doesn't go there

Ok so I have a rather weird issue: My UITextView becomes the first responder and I can tell because the keyboard appears, but what happens is that the pointer doesn't show up and the text can't be edited even if you type. This is the only UITextView in this controller, so it can't be triggering any other textview. Any ideas? Thanks :)

if (keyAuto) {
    [note becomeFirstResponder];
}

This is true, because if this BOOL is FALSE, it doesn't show at all. note is class level, so it can be called like this with no problems.

That's the code that creates note

note = [[UITextView alloc] initWithFrame:CGRectMake(0, 44 + lineHeight, widthv, heightNote)];
note.delegate = self;
note.returnKeyType = UIReturnKeyDone;
[note setFont:[UIFont systemFontOfSize:17]];
[noteView addSubview:note];

Sorry guys, my bad, I forgot, I was trying to do that under viewDidLoad. Doing the same thing under viewDidAppear fixed all the issues. It was just that for some people viewDidLoad did the trick, so I expected the same, but apparently it didn't...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM