開發(fā)中經(jīng)常使用的HUD 如果只是簡單的提示轉(zhuǎn)圈并且有一個背景的話我是這么做的 下面是簡單的代碼
UIActivityIndicatorView *indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
CGRect frame = indicatorView.frame;
frame.size = CGSizeMake(80, 80);
indicatorView.frame = frame;
indicatorView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);
indicatorView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
indicatorView.layer.cornerRadius = 10;
indicatorView.layer.masksToBounds = YES;
[self.view addSubview:indicatorView];
[indicatorView startAnimating];
這段代碼在iOS開發(fā)中很簡單了 下面貼上一個效果圖
03BD7104-6694-4541-824F-0FBEE794A02D.png
效果和第三方的差不多吧 自己可以在簡單的封裝