I’d like to have textfield with constant text in it non-editable like:
ENTER YOUR NAME:
And clicking at textfield would get cursor right after :
The user should not be able to delete or edit "ENTER YOUR NAME:" also.
How can I implement this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Set the delegate of your text field to an instance of
UITextFieldDelegateimplementation, and use thetextField:shouldChangeCharactersInRange:replacementString:method to see if the user is attempting to change theENTER YOUR NAME:string:I don’t think there is a way to place the cursor directly, but you can make an empty selection after the trailing colon of the initial text as described in this answer.