iPhone上的大活动指示器

Yaz*_*zmi 11 iphone objective-c uikit ios

有谁知道如何用旋转活动指示器显示圆角平方?它在许多应用程序中使用.如果您不知道我在说什么,当您在Mac上更改音量但背景较暗时,它看起来像指示器.我不确定它是内置于iOS还是有人制作它.

就像这篇文章中的那个但不是全屏只是活动指示器 如何在iPhone上创建全屏模态状态显示?

gui*_*rto 19

这是我想要显示那种指标时使用的内容.

UIView *loading = [[UIView alloc] initWithFrame:CGRectMake(100, 200, 120, 120)]; 

loading.layer.cornerRadius = 15;
loading.opaque = NO;
loading.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.6f];

UILabel *loadLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 25, 81, 22)];

loadLabel.text = @"Loading";
loadLabel.font = [UIFont boldSystemFontOfSize:18.0f];
loadLabel.textAlignment = UITextAlignmentCenter;
loadLabel.textColor = [UIColor colorWithWhite:1.0f alpha:1.0f];
loadLabel.backgroundColor = [UIColor clearColor];

[loading addSubview:loadLabel];
[loadLabel release];

UIActivityIndicatorView *spinning = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinning.frame = CGRectMake(42, 54, 37, 37);
[spinning startAnimating];

[loading addSubview:spinning];
[spinning release];

loading.frame = CGRectMake(100, 200, 120, 120);
Run Code Online (Sandbox Code Playgroud)

然后,您只需将"加载"视图添加到您选择的视图中即可.

希望这是你需要的.


Dan*_*Ray 14

您的屏幕截图可能是David Sinclair的DSActivityView模块的用法.具体来说,就是它的DSBezelActivityView组件.或者如果没有,它是一个密切的副本.

http://www.dejal.com/developer/dsactivityview

我一直使用DSActivityView.很棒的图书馆 在提取数据的同时抛弃这一点,让用户和客户满意.


jtb*_*des 11

一个选项:MBProgressHUD.


Dej*_*jal 5

我不认为截图是我的DSBezelActivityView ; 指标看起来有点不同.但它非常相似.

注意,DSActivityView及其子类不使用任何图像或笔尖; 他们是纯粹的代码.

要回答原始问题,可以轻松修改DSBezelActivityView以省略全屏灰色背景.您可以通过子类化和重写-setupBackground方法来实现:

- (void)setupBackground;
{
    [super setupBackground];

    self.backgroundColor = [UIColor clearColor];
}
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助!