In the iOS SDK, how can I enable a button in a UITextField, how does Mobile Safari do it?

How can I display a button and / or activity indicator inside a UITextField on an iPhone? I am trying to play a Mobile Safari location text box containing either a reload button or a cancel (stop loading) button that aligns correctly inside the text box.

Similarly, when you click inside the text field (not on the cancel / reload buttons) to edit the URL, a clear icon (x inside the circle) is displayed inside the text field, which deletes the contents of the text field.

How can I create this in my applications? I cannot do this through Interface Builder, so I suspect that this is being done in code.

+3
source share
2 answers

There is a built-in option that worked for me ... here:

Adding a "Clear" Button on iPhone UITextField

+1
source

Check out the TTMessageController .

0
source

Source: https://habr.com/ru/post/1760669/


All Articles