I have UITextField for login and password in authorisation window
the Password textField has securetyTextEntry = YES; After I press the "Show" button it's change to NO and user can see his password.
But when i press the button and it changed, in UITextField i SEE the space(image 2) but it's just visual, there are not any space or character. Help pleas
First image:
Second image:
Related
I'm trying to implement a feature where if a user taps on a button, it brings up the textfield for the user to type something in. Once the user is done, I want to navigate the user to another screen with text that he just typed.
How do I implement bringing up the textfield for the user to type in when the button is tapped?
on the button action just add self.yourTextField.becomeFirstResponder
...
then controller.text = yourTextField.text
...
I have a UI that includes a password entry field and a show/hide button. A tester has pointed out the following inconsistent behaviour.
If the password is hidden and half typed in (e.g. "abc") and the user hits the toggle button to show the password and continues typing then the new characters (e.g. "def") are added to the end of the initial entry (making "abcdef"). All well and good.
However, if the password is shown and half typed in (e.g. "abc") and the user hits the toggle button to hide the password and continues typing then the new characters (e.g. "def") replace the initial entry (making "def"). So the show/hide toggle not only shows or hides the text but also changes the behaviour of the UITextField (append / clear and start over) when the next character is entered.
Why is this happening?
Correct it is normal behaviour of UITextField and you can fix this using:
textField.clearsOnBeginEditing = NO;
Or in Swift:
textField.clearsOnBeginEditing = false
But it will not work if you use secure text for password.
See One of the answer:
Secure UITextField Answer
you can realization the effect you want by change your mind.
you can init a NSString *pwd to store the user's password, when user del or replace password , you change your pwd value, make sure your pwd always equal to user's typed password.
when user click the toggle button,you show the pwd value on the textfield.
I'm working on profile user level, and I noticed in different apps the fact they can do what I'm going to explain below :
From profile page the new user tape on a button : username
they go to another page to choose a username
after that they go to choose password
once everything it's done they comeback to profile page
I want make the initial button username --> username textfield once the operation it's done
Thanks
Check conditions when a user has already entered his name then hide your button and when user has not entered username then hide text field. You can hide the button by using button.hidden = true and make it false if you want to show your button or a text field.
I have a textfiled of secure type i.e password textfield and I have one button when I am clicking on it is showing entered password.
Here is reference code...
......
UIButton *showPwdBtn = (UIButton*)sender;
showPwdBtn.selected = !showPwdBtn.selected;
[self.passwordTextField setSecureTextEntry:!showPwdBtn.selected];
.......
But when I am doing monkey testing after clicking randomly on show password button, setSecureTextentry is not updating uitextfiled with secure type.
When user will click on Show password password will be visible and when he deselect show password button password will again change to secure (*) text.
but unfortunate its not working for monkey testing...why setSecureTextentry is not updating?
can you please try this
showPwdBtn.selected = !showPwdBtn.selected;
[self.passwordTextField setSecureTextEntry:showPwdBtn.selected];
with only one not operation
I have a UITextField in my app. When the user selects it, a keyboard is presented with a done button. The keyboard is dismissed by pressing the done button. But the done button is only enabled after the user has entered text. I want the user to have the option of dismissing the keyboard without entering text. Is it possible to enable the done button before text has been entered?
OK, I discovered this is resolved by unchecking the Auto-enable Return Key property in the Attributes Inspector.