iPhone/iPad 上 UIActivityIndi​​cator 下的阴影

发布于 2024-10-04 16:15:24 字数 82 浏览 0 评论 0原文

我想在动画 UIActivityIndi​​cator 下创建阴影以显示其他 ui 元素处于非活动状态,例如键盘或警报视图下的阴影。最好的方法是什么?

I want to create shadow under animated UIActivityIndicator to display that other ui elements are inactive, like shadow under keyboard or alert-view. What is the best way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事↓在人 2024-10-11 16:15:24

添加一个黑色背景且不透明度为 50% 的视图,如下所示:

UIView *shadowView = [[UIView alloc] initWithFrame:yourFrame];
[shadowView setBackgroundColor:[UIColor blackColor]];
[shadowView setOpacity:0.5];

[yourCurrentView addSubview:shadowView];
[yourCurrentView bringSubviewToFront:yourActivityIndicator];

Add a view with a black background and opacity to 50% with something like this :

UIView *shadowView = [[UIView alloc] initWithFrame:yourFrame];
[shadowView setBackgroundColor:[UIColor blackColor]];
[shadowView setOpacity:0.5];

[yourCurrentView addSubview:shadowView];
[yourCurrentView bringSubviewToFront:yourActivityIndicator];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文