我想在动画UIActivityIndicator下创建阴影,以显示其他ui元素处于非活动状态,例如键盘或警报视图下的阴影。这样做的最佳方式是什么?
答案 0 :(得分:3)
将具有黑色背景和不透明度的视图添加到50%,如下所示:
UIView *shadowView = [[UIView alloc] initWithFrame:yourFrame];
[shadowView setBackgroundColor:[UIColor blackColor]];
[shadowView setOpacity:0.5];
[yourCurrentView addSubview:shadowView];
[yourCurrentView bringSubviewToFront:yourActivityIndicator];