uikeyboard

Remove back drop,accessory bar of keyboard in iPhone 5s with iOS 8

拥有回忆 提交于 2020-01-24 15:02:11
问题 I am working on a app in which I have removed the back drop of keyboard using this code in iOS8 with iPhone 5: - (void)removeKeyboardTopBar { // Locate non-UIWindow. UIWindow *keyboardWindow = nil; for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { if (![[testWindow class] isEqual:[UIWindow class]]) { keyboardWindow = testWindow; break; } } // Locate UIWebFormView. for (UIView *possibleFormView in [keyboardWindow subviews]) { if([[possibleFormView description]

Show UITextField keyboard on firstResponder even when userInteractionEnabled = NO

主宰稳场 提交于 2020-01-24 08:49:46
问题 I have a UITextField that is first responder. I want to show keyboard when entering the view but I want to do that the user will not be able to edit it and the cursor will be hidden all time as well. When you click on a keyboard letter, it will be written in the UITextField, but the user will not be able to edit nothing there, even not to copy. Thanks! 回答1: Ok, per my comment, my solution is to have a surrogate UITextField that has its hidden property set to YES . What I do is add that hidden

How to Dismiss keyboard when touching away across the entire app

梦想的初衷 提交于 2020-01-24 07:45:49
问题 I have multiple textFields in different viewControllers where keyboard is popped up. I know how to dismiss keyboard when user clicks on a different part of the screen but I don't want to go and hard code it into every corner of my app. So is there anyway to enforce keyboard getting keyboard dismissed everywhere on the app when the user clicks anywhere on the screen other than keyboard ? I was thinking of extending the UIViewController, but I also have some textFields inside a view that I add

Adding Done Button to Only Number Pad Keyboard on iPhone

孤人 提交于 2020-01-21 05:25:07
问题 I am successfully adding a done button to my number pad with this handy code below. But I have an email button that launches the MFMailComposeViewController. How would I make sure the done button does not appear on the email keyboard? // // UIViewController+NumPadReturn.m // iGenerateRandomNumbers // // Created by on 12/4/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "UIViewController+NumPadReturn.h" @implementation UIViewController (NumPadReturn) -(void)

Adjusting a UIView when the keyboard shows or hides

天大地大妈咪最大 提交于 2020-01-17 01:13:26
问题 I am adding a keyboard observer to adjust the view height when the keyboard shows. But when the text field is at the top of the view and the keyboard shows, the text field goes up even more. Can someone please guide me on how to fix this properly because after performing lots of searches, they all suggest the same thing. I am using iOS 9 on an iPhone 5. Here is my code. In viewDidLoad() : //SET OBSERVER WHEN KEYBOARD IS SHOWN NSNotificationCenter.defaultCenter().addObserver(self, selector:

How can I disable the decimal key on iOS keyboard

一曲冷凌霜 提交于 2020-01-16 01:03:37
问题 I want to disable the "." key on the number pad after detecting that the user already has entered in one decimal point into the textfield. So the key is enabled until one decimal is detected in the textfield. What is the best way of doing this? EDIT: I've implemented the method below: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { if([string isEqualToString:@"."]) { decimalCount++; } if(decimalCount > 1) { [string

Swift: Checkbox insertion in UITextView of a UITableViewCell and using UITapGestureRecognizer to recognize taps on the checkbox

混江龙づ霸主 提交于 2020-01-13 18:04:53
问题 Introduction Context: I am working on one of my first own apps, a sort of note-taking app. The basic framework is simple: I have a UITableView with cells in them with a few design elements and a large UITextView which the user can write their notes into. Issue: I would like to implement the checkbox feature, similarly to what Apple has in their app "Notes". I want it to be a "part" of the text, so its erasable by hitting the erase on the keyboard. I have checked posts on SO about inserting a

Leaving inputAccessoryView visible after keyboard is dismissed iOS8?

天涯浪子 提交于 2020-01-11 09:25:12
问题 I want to make behavior like messaging app. I have been browsing Stack Overflow for solutions for this, and indeed there are plenty: Leaving inputAccessoryView visible after keyboard is dismissed This was the one that I found. But it seems things are a little different in iOS8 . If I do the same thing in new iOS8 sdk , i get error: 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fdcb3441b10> should have parent view controller:

Leaving inputAccessoryView visible after keyboard is dismissed iOS8?

纵然是瞬间 提交于 2020-01-11 09:25:02
问题 I want to make behavior like messaging app. I have been browsing Stack Overflow for solutions for this, and indeed there are plenty: Leaving inputAccessoryView visible after keyboard is dismissed This was the one that I found. But it seems things are a little different in iOS8 . If I do the same thing in new iOS8 sdk , i get error: 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fdcb3441b10> should have parent view controller:

Getting keyboard size from userInfo in Swift

不羁的心 提交于 2020-01-08 17:06:17
问题 I have been trying to add some code to move my view up when the keyboard appears, however, I am having issues trying to translate the Objective-C examples into Swift. I have made some progress, but I am stuck on one particular line. These are the two tutorials/questions I have been following: How to move content of UIViewController upwards as Keypad appears using Swift http://www.ioscreator.com/tutorials/move-view-when-keyboard-appears Here is the code I currently have: override func