Shadow under UIActivityIndicator on iPhone/iPad
-
27-09-2019 - |
Question
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?
Solution
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];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow