3

How can I display a button and/or activity indicator inside of a UITextField on the iPhone? I'm trying to reproduce Mobile Safari's location text field which contains either a reload button or a cancel (stop loading) button which is right-justified inside of the text field.

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

How can I create this in my own apps? I cannot seem to do it via Interface Builder so I suspect it's being done in code.

smountcastle
  • 620
  • 5
  • 14
  • Are you certain this is not just a clever layering of views and limited text field delegate resignation? – Aaron Aug 20 '10 at 03:04

2 Answers2

1

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

Adding the "Clear" Button to an iPhone UITextField

Community
  • 1
  • 1
beyerss
  • 1,302
  • 3
  • 21
  • 38
0

Check out TTMessageController.

kovpas
  • 9,553
  • 6
  • 40
  • 44