uitextfield

Manage UITextField's dynamic position using auto layout

 ̄綄美尐妖づ 提交于 2019-12-24 05:47:06
问题 My client’s requirement is as follows: I am going to create registration form with around 15 textFields(Pre defined on server). Information of fields in registration fields are coming from server. There are chances that some fields are not required in some cases. So, I will get fields which are required for that particular case. E.g. Suppose No. of predefined fields are 15 on server. i.e. FirstName, LastName, Phone no., Date of Birth, Picture, Email,Address,zipcode etc. But there are chances

iOS 7 Keyboard color flash

拟墨画扇 提交于 2019-12-24 04:21:48
问题 In iOS7, I set the keyboard for my UITextField in Interface builder to the dark style, however, whenever I click on the textField the keyboard initially shows as light for a fraction of a second before turning to the dark style, how can I have it not do this? 回答1: I had the same issue. It seems as though it only happens the first time the keyboard appears after an app has been suspended, and then resumed. I was never able to directly resolve the issue, but in my case, I was able to find a

iOS 7 Keyboard color flash

强颜欢笑 提交于 2019-12-24 04:21:11
问题 In iOS7, I set the keyboard for my UITextField in Interface builder to the dark style, however, whenever I click on the textField the keyboard initially shows as light for a fraction of a second before turning to the dark style, how can I have it not do this? 回答1: I had the same issue. It seems as though it only happens the first time the keyboard appears after an app has been suspended, and then resumed. I was never able to directly resolve the issue, but in my case, I was able to find a

iOS 8 Swift : How to keep the keyboard displayed when the UIAlercontroller is presented modally?

南笙酒味 提交于 2019-12-24 04:20:22
问题 The context is pretty simple, there is a UIViewcontroller with a textfield to enter a phone number. The textfield is in editing mode with keyboard. When the number is entered, the user can tap a button which displays an alert controller. As the alert is presented modally it covers the UIViewcontroller and removes keyboard, the editing is no more enabled. Thus my question, what should be done to keep the keyboard displayed behind the alert? 回答1: This solution worked let rootViewController:

How to move cursor from one text field to another automatically when the user clicks the Delete Button in swift ios programmatically?

左心房为你撑大大i 提交于 2019-12-24 01:55:47
问题 Currently, I have 6 textfields that I am moving from one textfield to the next, once a user clicks a number on the keypad. The issue I am trying to solve is: If the user clicks the Delete Button to go back to re-enter a different number, how do I code that in a program? How do I have the user go back to type in a new number on the keypad and also change the textfield back to its original code? I would like for the user to be able to type in on the keypad one number in the 6 fields and then

Change UITextField width dynamically depends of content

廉价感情. 提交于 2019-12-24 01:18:46
问题 I have the same issue as here: Resize a UITextField while typing (by using Autolayout) But It was resolved with UITextView and not with UITextField . This code doesn't help: func textFieldDidChange(sender: UITextField) { sender.invalidateIntrinsicContentSize() } I have UITextField (red background) and use AutoLayout with StackView: and constraints: but UITextField change it width only when it is resignFirstResponder . Could you give me please any advice about the issue? I'm new in Swift and

How to check whether Dictation is enabled in iOS Keyboard.?

时光毁灭记忆、已成空白 提交于 2019-12-24 00:45:15
问题 I have to show an Image highlighting the Mic icon in iOS keyboard saying "Tap here to speak". But the Mic icon won't be displayed if dictation is disabled in Keyboard settings. My aim is to check whether dictation is enabled at the time of launching the app. If not, I want to show a prompt to Enable Dictation from "Settings>KeyBoard>Enable Dictation" Is there any way to check whether dictation is enabled when the app is launched.? 回答1: Short answer is that checking whether the dictation is

resignFirstResponder when tapping UITableView?

匆匆过客 提交于 2019-12-23 22:41:45
问题 I have a UITableView with two custom cells and each of them has a subview with a UITextField inside it. I have tried adding a UIButton on top of the UITableView and have it resignFirstResponder but that just means you won't be able to tap anywhere else - not even on the UITextFields to enter text. How do I make it so if I tap outside those two UITextFields , I can call resignFirstResponder, so the user can get back to the other cells? Thanks 回答1: I asked a similar question and found an answer

Make text underlined in xcode

风格不统一 提交于 2019-12-23 22:07:11
问题 Hey I'm making an app that requires a certain part of a text view's text to be underlined. is there a simple way to do this like for making it bold and italics or must i make and import a custom font? thanks for the help in advance! 回答1: This is what i did. It works like butter. 1) Add CoreText.framework to your Frameworks. 2) import <CoreText/CoreText.h> in the class where you need underlined label. 3) Write the following code. NSMutableAttributedString *attString = [

ios 7.1 UITextField tint color doesn't change in storyboard

落花浮王杯 提交于 2019-12-23 21:11:22
问题 Up till iOS 7.0, the text field tint color changed to the color you set in storyboard. As of iOS 7.1, it won't change unless you do it programmatically. Is this a bug? Does anyone know? 回答1: Here is the solution to work with storyboard. 1) Go to "Identity Inspector" 2) Add "tintColor" attribute in "User Defined Runtime Attributes" 3) Set the desired color. Thats it. Or if you want to use same tint color for all textfields throughout the app, juse use, [[UITextField appearance] setTintColor