becomefirstresponder

Force UITextView cursor to the top of the view

非 Y 不嫁゛ 提交于 2021-02-11 05:35:30
问题 I have a UITableView that contains a series of text input fields, which can be UITextField or UITextView controls. When a text input field is selected, the keyboard's 'Next' button is used to cycle through the fields. This all works properly except for one thing. When a UITextView (multiline) receives focus by calling becomeFirstResponder, the cursor is positioned at the second line in the view, not the first. This seems to be the most common suggestion to address the issue, but it does not

Force UITextView cursor to the top of the view

烂漫一生 提交于 2021-02-11 05:33:27
问题 I have a UITableView that contains a series of text input fields, which can be UITextField or UITextView controls. When a text input field is selected, the keyboard's 'Next' button is used to cycle through the fields. This all works properly except for one thing. When a UITextView (multiline) receives focus by calling becomeFirstResponder, the cursor is positioned at the second line in the view, not the first. This seems to be the most common suggestion to address the issue, but it does not

Force UITextView cursor to the top of the view

若如初见. 提交于 2021-02-11 05:33:14
问题 I have a UITableView that contains a series of text input fields, which can be UITextField or UITextView controls. When a text input field is selected, the keyboard's 'Next' button is used to cycle through the fields. This all works properly except for one thing. When a UITextView (multiline) receives focus by calling becomeFirstResponder, the cursor is positioned at the second line in the view, not the first. This seems to be the most common suggestion to address the issue, but it does not

iOS 13 update broke my app's keyboard on its first display

随声附和 提交于 2020-01-30 11:25:29
问题 I'm updating an app developed for iOS 8 (kinda old), but I'm having issues on the first time the keyboard is being displayed after recent iOS 13 update: Keyboard appears as an effect of calling [textfield becomeFirstResponder], regardless if it's being called explicitly in the code (into the viewDidLoad method) or implicitly when the field is tapped, but only occurs the first time it appears after the view itself appears. I'm "solving" it calling [textfield becomeFirstResponder] and

UITextview: Place focus on becomefirstresponder

不羁岁月 提交于 2020-01-05 12:13:27
问题 I have a UITextView which becomes first responder by tapping. The code looks like this. UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editTextRecognizerTabbed:)]; recognizer.delegate = self; recognizer.numberOfTapsRequired = 1; [self.textViewNotes addGestureRecognizer:recognizer]; - (void) editTextRecognizerTabbed:(UITapGestureRecognizer *) aRecognizer; { self.textViewNotes.dataDetectorTypes = UIDataDetectorTypeNone; self

To move to next text fieds in table cell

佐手、 提交于 2020-01-03 00:56:13
问题 In my application , there is a table view with 2 text fields per cell. Am assigning tags for each text field. On pressing done button i want to make the next text field the first responder(can be between table cells). But the code now i am using does not work . attaching the present code NSArray *viewsToBecomeFirstResponder = [tableView subviews]; for (UIView *firstResponder in viewsToBecomeFirstResponder) { if ([firstResponder isKindOfClass:[UITextField class]]) { if (firstResponder.tag ==

UITextField becomeFirstResponder works only once

社会主义新天地 提交于 2019-12-24 08:01:13
问题 In my app, there is the ability for the user to input their name. A UITextField is added to the view and becomeFirstResponder is called. In the textFieldShouldReturn method, resignFirstResponder is called. Then in textFieldShouldEndEditing, the UITextField is removed from the view. This all works fine, but the problem is that when the user tries to input their name a second time, the UITextField shows but keyboard does not. I have tried lots of things, like moving around become/resign

UISearchBar cannot become first responder after UITableView did re-appear

限于喜欢 提交于 2019-12-24 02:18:54
问题 I have an iPhone app for iOS8. UIPageViewController has a child view of UITableViewController, and that's where I put UISearchController. When the UITableViewController is presented for the first time, I have no trouble activating the search by doing [self.searchController.searchBar becomeFirstResponder]; However, once the view controller gets invisible either by pushing to another table view controller, or modally presenting a UIViewController (visually masking it), the searchBar can no

Focus on the UISearchBar but the keyboard not appear

有些话、适合烂在心里 提交于 2019-12-21 04:03:51
问题 I've read so many solution on how can i focus a searchbar to make keyboard appear when i open my search view, and all of that are like this [searchBar becomeFirstResponder]; mine is [self.searchDisplayController.searchBar becomeFirstResponder]; but I tried both. Now, I tried this, and I also added a [self.searchDisplayController setActive:YES]; because I'm using a SearchDisplayController, but so far the best result i can have is to have the cursor on the searchbar, the uitableview with an

Show keyboard automatically with focus() event in UIWebView using Trigger.IO/PhoneGap

☆樱花仙子☆ 提交于 2019-12-19 04:15:16
问题 Supposedly, this has not been possible since iOS 6 where you can set the UIWebView's keyboardDisplayRequiresUserAction = NO. I'm using a html 5 webview (Trigger.IO) and building a native plugin but am having difficulty grabbing hold of the UIWebView instance. How do I grab hold of the webview so I can simply do the following: mywebview.keyboardDisplayRequiresUserAction = NO; Probably really simple.. what am I missing? 回答1: Access to the UIWebView isn't something we properly expose in the