inputview

UITextField inputView displays undo, redo, paste buttons

回眸只為那壹抹淺笑 提交于 2020-12-29 05:21:45
问题 I have created a custom inputView for my UITextField . The view itself looks and functions great, but on the iPad I'm getting undo, redo, and paste buttons above my custom inputView . How do I remove those buttons? They don't have any functionality, but they should be removed. 回答1: With Swift 3 and XCode 8 I was able to remove the bar by removing the two button groups on the text field input: self.textField.inputAssistantItem.leadingBarButtonGroups.removeAll() self.textField

Slide UIInputView with UIViewController like Slack

旧巷老猫 提交于 2020-01-07 03:07:28
问题 I'd like to use the UIViewController's input accessory view like this: override func canBecomeFirstResponder() -> Bool { return true } override var inputAccessoryView: UIView! { return self.bar } but the issue is that I have a drawer like view and when I slide the view open, the input view stays on the window. How can I keep the input view on the center view like Slack does it. Where my input view stays at the bottom, taking up the full screen (the red is the input view in the image below):

iOS 8 broke UIPickerView in UIActionSheet

烂漫一生 提交于 2020-01-01 12:11:04
问题 I was presenting a picker in UIActionSheet very simply up until iOS 8. Now, it seems they have broken that capability with the latest update. It was never supported and the practice was discouraged in the docs all along. Presumably the entire UIActionSheet capability is deprecated and will not be supported going forward. The documentation says to use UIAlertController instead. I have tried switching to the UIAlertController and actually found what I initially expected would be a nicer

Custom inputView for UITextField , how do I direct input back to the text field?

旧街凉风 提交于 2019-12-29 22:06:17
问题 I have set a custom inputView to my UITextField . I need a way to display the data selected in my custom inputView in the UITextfield . I would like to achieve this the same way the system keyboard does it. Does anyone know how this is done? How does the system keyboard get a reference to the UITextfield that is the first responder? 回答1: How does the system keyboard get a reference to the UITextfield that is the first responder? It just asks the system for the first responder; unfortunately,

Load a nib file to act as a custom keyboard when a UITextField is tapped

余生颓废 提交于 2019-12-23 17:59:54
问题 I'm trying to load a .xib file to act as a custom keyboard when a textField is tapped. I'm able to show the .xib file (view) when the textField is tapped but I'm not sure how to communicate the buttons in the .xib file with the a textField in the ViewController.swift . This is what I have done so far. Created a single project. Added a UITextField and created an outlet for it. @IBOutlet weak var myField: MyTextField! Created a new .xib file and called it CustomView.xib . Created a new class

Disable Keyboard for UITextfield

前提是你 提交于 2019-12-22 10:28:36
问题 I'm wondering how to disable the inputview of a UITextfield. Setting textField.inputView = nil; or [textField setInputView:nil] in ShouldBeginEditing doesn't do anything, and using the userInteraction property removes the ability to interact with the field. Ideally, I'd like to remove both the cursor and the keyboard while still being able interact with and switch between textfield methods, using ShouldBeginEditing and ShouldEndEditing. Is there any way to accomplish this? 回答1: You should do

iOS UITextField- dismissing custom inputView

折月煮酒 提交于 2019-12-21 12:17:22
问题 I am using a custom inputView for some textfield, however when i call resignFirstResponder on the textfield, the custom input view does not dismiss...any suggestions? UITextField *f=[[UITextfield alloc] init]; UIView *view=[[UIView alloc] initWithFrame..]; [f setInputView:view]; //random example of how to set a textfields input view to a custom view After some research, this issue only occurs when working with a viewController thats presented in a modal view...it works ok otherwise... Thanks

iOS - Dismiss UIDatePicker presented as inputView

∥☆過路亽.° 提交于 2019-12-19 18:56:17
问题 I have a text field in my UI that when it's selected presents a UIDatePicker instead of the default keyboard, how could I set up a button as to dismiss the picker when the user is done? 回答1: What I do is have my inputView as a custom view which contains a UIDatePicker and a toolbar above it with a 'Done' button wired up to a method that calls a delegate method to tell the object that owns the UITextField to dismiss the "keyboard" by calling resignFirstResponder . 回答2: Create a UIView (namely

Prevent custom keyboard in textfield

六月ゝ 毕业季﹏ 提交于 2019-12-18 19:04:29
问题 I was experimenting with how a custom keyboard affects my app. I installed Swype on my iPhone 6. I find that in some of my views where I have custom inputView property set on a text field, the Swype keyboard is overriding and presenting instead of my picker. This completely breaks my UI and cannot be allowed. Is there a way to explicitly tell iOS 8 only to use the inputView I have set? Is this a bug, perhaps? It is not at all expected behavior to allow a third party to override my input spec?

Custom Keyboard: inputView: how to change the Keyboard size?

笑着哭i 提交于 2019-12-17 22:55:17
问题 I implemented the textfield with a custom keyboard with the "setInputView" function. But i have a problem: my keyboard frame is not a standard iphone keybord frame. The question is: How can i change the size of my custom keyboard? I know some functions like: UIKeyboardFrameBeginUserInfoKey, ..etc. Please Note: The iPhone keyboard frame is = 0,264,320,216 My custom keyboard frame is = 0,0,320,460 Hoping for your kind collaboration, Best regards... P 回答1: It turns out that the default behaviour