uitextfield

Change Keyboard Language In iOS App When Click In UITextField

只愿长相守 提交于 2019-12-22 17:35:07
问题 i tried many ways to change keyboard in ipad programmatically but it doesn't change at all . i cant find any property in uitext for doing this. any idea? 回答1: Unfortunately, you cannot control the language of the keyboard. The user chooses which keyboards they would like available via the settings application and can toggle between them using the globe icon on the keyboard. When the keyboard is opened it will open to the most recently used keyboard. Here is what you need my friend, [textView

UIDatePicker as inputView

牧云@^-^@ 提交于 2019-12-22 13:51:31
问题 I have two problems at UIDatePicker as inputView. 1: When I select "April 17 9 00 PM" in datePicker, dateTextField outputs "2014-04-107 21:00:00". 2: UTC of My country is +0900. But, NSLog outputs "2014-04-17 12:00:00 +0000". How do I fix these problems? @property IBOutlet UITextField* dateTextField; @property IBOutlet UIDatePicker* datePicker; @property UIToolbar* toolBar; - (void)viewDidLoad { self.datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 600, 320, 216)]; [self.view

iOS - How to set textfield hint to italic (with regular actual text)?

穿精又带淫゛_ 提交于 2019-12-22 10:34:01
问题 Is there any easy way to set a text field's hint to italic, while keeping the actual text non-italicized? The image below shows what I'm trying to accomplish, but doesn't actually work, as text typed into the first text field is still italicized. If there's no easy way to do this, I'm thinking that I'll have to implement methods on each of the text fields to check the length of the text, and if zero apply the italic font. This would work, right? Is there a better way? 回答1: Try this: UIFont*

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

UITextInput protocol usage for UITextField and UITextView to manage selection results in crash

白昼怎懂夜的黑 提交于 2019-12-22 09:55:17
问题 UITextField and UITextView both adopt the UITextInput protocol. UITextView's selectedRange property returns NSRange, where UITextField doesn't have any selection properties/methods. I'd like to use one routine to manage insertion in either UITextField or UITextView. So I do the following: id<UITextInput> textInput = nil; if ([self.aTextView isFirstResponder]) { textInput = self.aTextView; } else if ([self.aTextField isFirstResponder]) { textInput = self.aTextField; } if (textInput != nil) {

Is it possible to animate UIEdgeInsets?

…衆ロ難τιáo~ 提交于 2019-12-22 08:11:21
问题 I've been trying to animate a change in UIEdgeInsets . I've already tried using UIView.animateWithDuration and the insets just jump to the final values. Does anyone know if this a property that can't be animated? Or better yet, is anyone aware of a way to animate insets? As an example: // Starting inset values self.searchField.placeHolderInset = UIEdgeInsets(top: 0, left: 110, bottom: 0, right: 10) // Animation block UIView.animateWithDuration(0.1, animations: { self.searchField

Centering Placeholder Text in Subclass of UITextField

谁说胖子不能爱 提交于 2019-12-22 07:08:10
问题 So first, I needed to set the placeholder text color, so I subclassed the UITextfield as shown in several stack overflow posts. This works fine. Here is an example post of this: How do I subclass UITextField and override drawPlaceholderInRect to change Placeholder color. But, when I try to use searchNameField.textAlignment = UITextAlignmentCenter; It is no longer centering the placeholder. The input text is still centered fine. So then, assuming that the centering is not working because of

Keyboard is not working proper in ios7 (Xcode 6)

不想你离开。 提交于 2019-12-22 06:59:08
问题 I have recently installed Xcode 6 in OS X Mavericks.In iOS 8 my app is working fine. But in iOS 7 sometime keyboard does not appear when i tap on textfield or textview. Any ideas? 回答1: To fix this, on simulator, open the Menu: Hardware - Keyboard - Toggle software menu (make sure it's checked) link here 来源: https://stackoverflow.com/questions/25805689/keyboard-is-not-working-proper-in-ios7-xcode-6

UITextVIew secureTextEntry not working

≯℡__Kan透↙ 提交于 2019-12-22 06:40:22
问题 Possible Duplicates Here & here (But they don't have solution for my problem) I am creating a chat UI where my textbox MUST have both Multiple Line feature and Secure Text Entry Feature. UITextField doesn't have Multiple Line Feature UITextView doesn't have Secure Text Entry Feature What should i do now ? Another doubt, if secureTextEntry for UITextView not going to work, why the heck they put that property inside UITextView Class 回答1: Only UITextField supports secureTextEntry, making a font

How to get UITableViewCell's index from its edited UITextField

末鹿安然 提交于 2019-12-22 06:29:17
问题 I'm working on an iPhone based BI project. I have a UITextField in a UITextViewCell , the UITextFieldDelegate points to my UITableViewController , I haven't done any sub-classing for the UITextViewCell nor the UITextField . Now after the text field end editing on the delegate -(void)textFieldDidEndEditing:(UITextField*)textField I need to know the row index of the current cell I'm editing, is there any way to get the parent cell of the text field? Or can I set some property to the textfield