uitextfield

iOS 8 UIView not moving up when keyboard appears

江枫思渺然 提交于 2019-12-04 08:33:11
问题 I am developing a chat app which has UITableView and a UIView containing a UITextField and a UIButton in it. I am using the following code to move the UIView up when keyboard appears. (void)keyboardWillShow:(NSNotification *)notification { NSDictionary* info = [notification userInfo]; CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; [UIView animateWithDuration:0.2f animations:^{ CGRect frame = self.inputView.frame; UIInterfaceOrientation orientation =

UITextField doesn't end editing when Button clicked( delegate textFieldDidEndEditing )

荒凉一梦 提交于 2019-12-04 08:24:36
I have two textFields on the screen and a Submit button . User inputs details in first textField and then the second one. My requirement is to end the editing when Submit button is clicked and print the user inputs in these textFields .I am having issues printing the second textField's value, as the editing never seems to end when the user clicks the Submit button . Here is my code. Appreciate your help on this issue (I have added the textfield delegate) import UIKit class ViewController: UIViewController, UITextFieldDelegate { var firstName = "" var lastName = "" @IBOutlet var buttonUI:

UITextfield to be displayed on top of Keyboard - Beginner

别等时光非礼了梦想. 提交于 2019-12-04 07:55:12
I have textboxes . When i click on it, the Keyboard pops out. but, since the uitextfield is located some where below, it gets covered when the keyboard pops out. (The keyboard gets displayed above the text field, so the user is unable to see it). I need a way to move the textfield up so that the user can see it. The iPhone facebook app has a workaround, they shrink the UIComponents on the view to display the textfield on top, so it doesn't cover from the keyboard. Can someone point me to a tutorial or sample code to start with? Parth Bhatt OPTION-1: You can refer to this code which has been

XCode 6.1 iOS 8 keyboard decimal pad is not properly

家住魔仙堡 提交于 2019-12-04 07:42:15
My iPhone app was normal in xCode 5 and iOS 7. When I updated to xCode 6.1, it was still normal. But after I update iOS 7 to iOS 8 (now xCode 6.1 and iOS 8), the keyboard type DecimalPad of uitextfield is not working property The decimal button is a half the size it should, and when touch on the "red rectangle", the number "7" is selected. It also warning "Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 1425143906_Portrait_iPhone-Simple-Pad_Default". I run it on iPhone 5S device. Is it xCode 6.1 or iOS 8 problem? Any solution to fix? Thank you very much!

Change cursor in UITextField when set new text

旧城冷巷雨未停 提交于 2019-12-04 07:25:11
I discovery one thing. If i set yes to function - textField:shouldChangeCharactersInRange:replacementString: The cursor stay in the same place I type, like ("|" = cursor) "|" => Empty , type a "a|" => type b "ab|" => change cursor "a|b" => type c "ac|b" => type d "acd|b" => change cursor "ac|db" => type backspace "a|db" => type backspace again "|db" => *result* But, if I have to change the text, like put a "-" in penultimate character, I do the logic thing and set the text with: [textField setText:newText]; But the sample above will be in this way: "|" => Empty , type a "a|" => type b (put

iPhone 5 Keyboard sizing

丶灬走出姿态 提交于 2019-12-04 07:17:10
I've been testing my app in the 4-inch and 3.5-inch iPhone simulators, and when bringing up a keyboard with a UITextField in the 4-inch simulator in landscape mode, it's squished up to the side. It looks like a normal 3.5-inch keyboard: Am I missing something telling it to stretch properly? Please note - I don't have access to an actual iPhone 5 device to test on. Any help would be appreciated. Maybe your simulator is set to the 4-inch model but is running iOS5--this setup is possible in iOS Simulator but doesn't exist in the wild. 来源: https://stackoverflow.com/questions/12797419/iphone-5

Some UITextfields don't respond in iOs6

可紊 提交于 2019-12-04 07:09:35
Since updating to iOS 6 I have this weirdest bug when trying to make an UITextField or UITextView firstResponder. ...it doesn't work. I am not able to select the field or view and bring up the keyboard, nor is there a cursor or anything. The weirdest thing is that it is only not working for SOME fields, other ones in different viewcontrollers work without trouble. I have: [self.window makeKeyAndVisible]; self.window.rootViewController = self.viewController; in my appDelegate. It worked and still works without problems with iOS 5. Any ideas on what it could be? Thanks! I found out what was

iPhone: Jump to next uitextfield in uitableview, how to?

依然范特西╮ 提交于 2019-12-04 07:00:21
In my iPhone project I'm using a UITableview with UITableViewCells containing UITextfields. I have seen in many apps that it is possible to use a next button to jump to the next textfield in the next cell. What is the best way to accomplish this? My idea is to get the indexPath of the cell with the textfield that is being editing and then get the next cell by cellForRowAtIndexPath. But how can I get the indexPath of the cell I'm currently editing? Thanks! Keep references to the UITextField instances in your table view. Assign unique tag values to your UITextField instances. In your last text

Adding input accessory view to UITextField while keyboard is visible

戏子无情 提交于 2019-12-04 06:55:13
I would like to add an input accessory view to a UITextField while it is the first responder, i.e. showing the keyboard. Apparently, assigning a UIView to the inputAccessoryView property in this state doesn't display this view. I have to first dismiss the keyboard and re-select the UITextField . Is there a way to add an input accessory view without dismissing and re-selecting? If possible only assign the inputAccessoryView once. If you need it to be customized, and can only determine how very late just before becoming the first responder, then I would still only assign it once. But customize

UIViewControllerHierarchyInconsistency crashes app only in iOS 8 and Xcode 6

社会主义新天地 提交于 2019-12-04 06:47:14
i have an app which work fine in iOS 7 and Xcode 5. As soon as I updated it to iOS 8 and Xcode 6 it crashes when app try to slide up UIDatePicker in the view when a textField is tapped. I am using storyboard. Anybody has idea why? i have read upon this but its for Xib. App crashes on IOS 6 - UIViewControllerHierarchyInconsistency please help thanks my code: - (void)textFieldDidBeginEditing:(UITextField *)textField { //set picker color start [self.myDatePicker setBackgroundColor:[UIColor greenColor]]; //set picker color finish //calculate bounds start CGRect textFieldRect = [self.view.window