开发者

In the iOS SDK, how can I include a button in a UITextField like Mobile Safari does?

开发者 https://www.devze.com 2023-01-12 14:25 出处:网络
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 can

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开发者_如何学JAVA 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.


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

Adding the "Clear" Button to an iPhone UITextField


Check out TTMessageController.

0

精彩评论

暂无评论...
验证码 换一张
取 消