uitextfield

Keyboard covering UITextView in Notes App

扶醉桌前 提交于 2019-12-25 01:45:18
问题 Hi guys I am making a notes app and I ran into a big problem. I am using a UITextView as the notepad. When the keyboard comes up it blocks some of the text in the UITextView. I have a input accessory view on the UITextView. I tried to find the answer in the internet and can not find a good answer.Any way to fix it? Here is a picture: 回答1: You might want to look at modifying the UITextView's contentOffset and contentInset. UITextField is a UIScrollView subclass after all. 回答2: I decided to

iOS: Adding underlineStyle attribute to NSAttributedString, makes the text view disappear

独自空忆成欢 提交于 2019-12-25 00:53:04
问题 I've create a UITextView in storyboard. Added attributes to the string. All goes well, until I add underlineStyle attribute. Then the text view disappears. class ViewController: UIViewController { @IBOutlet weak var textView: UITextView! override func viewDidLoad() { super.viewDidLoad() let text = "random text <a href='http://www.google.com'>http://www.google.com </a> more random text" let attributedText = htmlStyleAttributeText(text: text)! let underLineColor: UIColor = UIColor(red: 245/255,

UIAlertView textfield capture onchange

荒凉一梦 提交于 2019-12-25 00:21:10
问题 I'm trying to implement custom AlertView. The idea is to have alertview with textfield and cancel button. What i can't do is to check textfield live for entered characters. I know i can do it using – alertViewShouldEnableFirstOtherButton: but i don't want another button. I wish to do the same just without button. In android you can add listeners to textfields onchange. Tried to do it using this uitextfield function, but it doesn't get called live or maybe i'm using it in a wrong way. - (BOOL

Forcing entry of certain character types in UITextField

拟墨画扇 提交于 2019-12-24 23:17:12
问题 If I have a UITextField which the user is inputing a registration number, which has the format: 11-11-1111 (that is 2 digits, a dash, 2 digits, a dash, four digits) How do I force the user to enter this kind of data only (as they are actually entering it)... so they can't enter anything except 0-9 in the first character, and only '-' for the third character etc. 回答1: From a UX point of view, since the '-' characters are fixed, limit the input to just 0-9 by setting the keyboardType property

Auto extend width to text field

爱⌒轻易说出口 提交于 2019-12-24 21:15:54
问题 How to get the text field with auto extend based on the browser width (with pure css). For example if I scale the browser to minimum width also the text field should not jump to the second line. I need exactly like how it is shown in this image 回答1: Not 100% sure it's the desired effect but for some browsers this might be what you're looking for: html: <p> <label>Test</label> <span><input></span> </p>​ And css: label{width:200px;float:left;} span{display:block;width:100%;box-sizing:border-box

UITableView as inputView for UITextField didSelectRowAtIndexPath randomly not fired

爷,独闯天下 提交于 2019-12-24 14:34:59
问题 I have a UITableViewController that I'm using to override the inputView of a UITextField subclass. Sometimes the tableView didSelectRowAtIndexPath stops getting fired until a user scolls the table and tries to click again. I can't seem to get a fix on what would cause the cells to become unresponsive. Most of the time it works great, but randomly the cells stop responding to touches until the user scrolls the tableview a bit. I don't have any TapGestureRecognizers in the view to my knowledge,

Avoid keyboard closing when iPhone rotated XCode Swift

青春壹個敷衍的年華 提交于 2019-12-24 12:34:23
问题 I have in left navigation item UITextField . When I type something in there and rotate device, keyboard hides everytime. I tried to handle UIKeyboardWillHideNotification , but all what I got is: keyboard closes and shows again after that. It's not good, I need to rotate keyboard along with view... Please help in Swift 2 . 回答1: Okay, I found the solution! First, need to implement delegate: ViewController: UIViewController, UITextFieldDelegate Next, add to viewDidLoad method: override func

Keyboard dismisses after multiple UIAlertViews are opened

故事扮演 提交于 2019-12-24 12:20:02
问题 I am having a weird issue with my keyboard automatically closing and then reopening when I open multiple UIAlertViews. If I have a keyboard (from a separate UITextField) and I display a UIAlertView, then upon dismissal of that alert I open another (opening the second one in the didDismissWithButtonIndex). When I dismiss the 2nd one it dismisses the keyboard which then comes back up. If i try this with more than 2 alerts in a row, it will still close my keyboard after the 2nd alert is

How do I stop UITextField Secure text showing characters

偶尔善良 提交于 2019-12-24 12:07:42
问题 I've enabled Secure text for my UITextField. At runtime when I type some text in I initially see the character before it turns to a bullet point. Is there a way to stop it showing the characters and having it as a bullet point as I type. Is there something I need to add to -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string Has anyone got an example? 回答1: That is the default behaviour of the UITextField . So there's

adding uitextfield or (textentry box with keyboard) in sprite kit

只愿长相守 提交于 2019-12-24 11:36:45
问题 I am recently working on sprite kit to create a simple game where user input name as identity and moves forward to play game and has option to edit name or replace name. Which is best option to use uitextfield : in skscene or viewcontroller ? Or any other solutions? I had tried with uitextfield adding in skscene but got memory issue (since i called scene from viewwilllayoutSubview override func viewWillLayoutSubviews() { let skView = self.view as! SKView skView.ignoresSiblingOrder = true let