inputaccessoryview

iOS 11 inputAccessoryView broken

社会主义新天地 提交于 2019-12-02 22:03:27
问题 I have the following set up for my UIToolBar / Accessory View on a view controller @IBOutlet var inputFieldView: UIToolbar! override var canBecomeFirstResponder: Bool{ return true } override var inputAccessoryView: UIView?{ return self.inputFieldView } then inside my viewDidLoad I have: let seperator = UIView(frame: CGRect(x:0 , y: 0, width: ScreenSize.width(), height: 1)) seperator.backgroundColor = UIColor.lightBackground self.inputFieldView.addSubview(seperator) self.inputFieldView

how can i increase the height of an inputAccessoryView

筅森魡賤 提交于 2019-12-02 20:54:30
I have spent several days on this with no solution in sight. I have an inputAccessoryView which consists of a UIView containing a textView and two buttons. The behaviour of the inputAccessoryView is as expected and works fine in all cases except one. When the height of the textView increases, I am trying to increase the height of the inputAccessoryView by the same amount. When I redefine the height of the inputAccessoryView in textViewDidChange , the inputAccessoryView increases height downwards over the keyboard instead of upwards. I have tried many different suggestions from SO but nothing

iOS 11 inputAccessoryView broken

不羁岁月 提交于 2019-12-02 07:31:53
I have the following set up for my UIToolBar / Accessory View on a view controller @IBOutlet var inputFieldView: UIToolbar! override var canBecomeFirstResponder: Bool{ return true } override var inputAccessoryView: UIView?{ return self.inputFieldView } then inside my viewDidLoad I have: let seperator = UIView(frame: CGRect(x:0 , y: 0, width: ScreenSize.width(), height: 1)) seperator.backgroundColor = UIColor.lightBackground self.inputFieldView.addSubview(seperator) self.inputFieldView.isTranslucent = false self.inputFieldView.setShadowImage(UIImage(), forToolbarPosition: .any) self

How do I create a keyboard accessory view with Auto Layout in Interface Builder?

余生颓废 提交于 2019-12-01 18:40:29
I want to add a "Done" button and a segmented control to a Decimal Pad keyboard. Ideally I would like to lay out a keyboard accessory view with Auto Layout in Interface Builder. Is this even possible? Do I create a new XIB or can I do it in the existing Storyboard scene somehow? How do I attach the accessory view to the appropriate text field? Would you mind doing it programmatically? Typically you take a UIToolbar to a UITextField with your items, but you may need to subview the UISegmentedControl; UIToolbar *keyboardToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen

Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency',

[亡魂溺海] 提交于 2019-11-29 06:03:06
I created a toolbar above the picker with two buttons and worked on ios7, when i run in ios8 crash: Terminating app two to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller: Should Have parent view controller: but requested parent is: ' This is the piece of code that worked quietly in ios7: expiredPromoTextField.inputView = DatePicker; expiredPromoTextField.delegate = self; quantityPromoTextField.inputView = quantityPicker; quantityPromoTextField.delegate = self; // Create button to close the UIPickerView UIToolbar * mypickerToolbar = [[UIToolbar alloc

Changing the frame of an inputAccessoryView in iOS 8

痞子三分冷 提交于 2019-11-28 17:03:35
Long time lurker - first time poster! I am having an issue while recreating a bar with a UITextView like WhatsApp does it. I am using a custom UIView subclass, and lazily instantiating it on: - (UIView *)inputAccessoryView and returning YES on: - (BOOL)canBecomeFirstResponder Now, I want to change the size of the inputAccessoryView when the UITextView grows in size. On iOS 7, I would simply change the size of the frame of said view - and not it's origin -, and then call reloadInputViews and it would work: the view would be moved upwards so that it is fully visible above the keyboard. On iOS 8,

Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency',

谁说我不能喝 提交于 2019-11-27 23:31:13
问题 I created a toolbar above the picker with two buttons and worked on ios7, when i run in ios8 crash: Terminating app two to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller: Should Have parent view controller: but requested parent is: ' This is the piece of code that worked quietly in ios7: expiredPromoTextField.inputView = DatePicker; expiredPromoTextField.delegate = self; quantityPromoTextField.inputView = quantityPicker; quantityPromoTextField

iPhone X how to handle View Controller inputAccessoryView?

丶灬走出姿态 提交于 2019-11-27 18:50:36
I have a messaging app that has the typical UI design of a text field at the bottom of a full screen table view. I am setting that text field to be the view controller's inputAccessoryView and calling ViewController.becomeFirstResponder() in order to get the field to show at the bottom of the screen. I understand this is the Apple recommended way of accomplishing this UI structure and it works perfectly on "classic" devices however when I test on the iPhone X simulator I notice that using this approach, the text field does not respect the new "safe areas". The text field is rendered at the