开发者

iOS Safari refresh button. Can I use it?

开发者 https://www.devze.com 2023-02-21 16:40 出处:网络
I have some text field and I need refresh button like in Safari navigation bar. How can I use it instead of making my own?

I have some text field and I need refresh button like in Safari navigation bar.

How can I use it instead of making my own?

开发者_运维知识库

iOS Safari refresh button. Can I use it?


The refresh graphic itself can be extracted using UIKit Artwork Extractor. (Or, get a refresh icon from one of the many free iphone icon sets, like Glyphish)

To place it in a UITextField like in Safari, set the UITextField rightView property to a UIImageView or UIButton with the image set to the refresh image.

UITextField* myTextField = [[[UITextField alloc] initWithFrame: CGRectMake(0,0,200,44)] autorelease];

myTextField.rightView = [[[UIImageView alloc] initWithImage: [UIImage imageNamed: @"UIButtonBarRefresh.png"]] autorelease];

You'll want to use a UIButton instead of a UIImageView if you want to get the TouchUpInside notification for the refresh button.


It's a custom safari widget. You have to make your own.

0

精彩评论

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