Posts

Showing posts with the label uitextfield

How to disable isEnable and isUserInteraction attributes but keep cursor show in UITextField?

Image
Clash Royale CLAN TAG #URR8PPP How to disable isEnable and isUserInteraction attributes but keep cursor show in UITextField? I have a custom framework for UITextField . For now, I want to disable two attribute as the question above but still keep the cursor show in my custom textfield. I already disable the keyboard with set the inputView = UIView() , and that successful for hide the keyboard even show the cursor inside textField. UITextField inputView = UIView() My goal is disable both attributes like above or another for can not Select All action from my textField, but still keep the cursor available anytime. Select All Hope to hear the ideas from you guys. Thank a lot! Put a dummy view above textview with clear color, and show and hide that view. – Bista 31 secs ago By ...

How can I move the clear button in a UITextField?

Image
Clash Royale CLAN TAG #URR8PPP How can I move the clear button in a UITextField? For some reason, when I add a UITextfield as a subview of the contentview of a tablecell, the clearbutton does not align with the text typed in the field, and appears a bit underneath it. Is there any way I can move the text of the clearbutton to stop this from happening? Thanks for any help, 6 Answers 6 I haven't seen this, and a screen shot would be helpful. But, the quick answer is that you can inspect the subviews array of the UITextField, find the subview that contains the clear button, and adjust its frame.origin. Edit: It seems I've been downvoted for this answer (written in 2010). This is of not an "officially" approved method because you're manipulating private objects, but it's not detectable by Apple. The main risk is that the view hierarchy might be changed at some point. ...