是否可以在UITextField的背景上显示UIProgressView样式矩形?

时间:2011-05-20 07:54:57

标签: iphone

是否可以在UITextField的背景上显示UIProgressView样式矩形? 只是喜欢Safari的网址栏显示加载网页时的进度。

欢迎任何评论

1 个答案:

答案 0 :(得分:0)

您可以显示任何视图但不能显示为背景属性,您可以像子视图一样添加它。

您可能需要UIActivityIndicatorView Class Reference

    UIActivityIndicatorView *activityIndicatorView =[[UIActivityIndicatorView alloc] 
                                                      initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

    [activityIndicatorView startAnimating];
    activityIndicatorView.frame = activityIndicatorFrame;

    [yourTextField addSubview:activityIndicatorView];
    [activityIndicatorView release];

UIProgressView没有这样的样式矩形。

UIProgressViewStyle
The styles permitted for the progress bar.

typedef enum {
   UIProgressViewStyleDefault,
   UIProgressViewStyleBar,
} UIProgressViewStyle;
Constants
UIProgressViewStyleDefault
The standard progress-view style. This is the default.
Available in iOS 2.0 and later.
Declared in UIProgressView.h.
UIProgressViewStyleBar
The style of progress view that is used in a toolbar.
Available in iOS 2.0 and later.
Declared in UIProgressView.h.
Discussion
You can set and retrieve the current style of progress view through the progressViewStyle property.

Availability
Available in iOS 2.0 and later.
Declared In
UIProgressView.h