Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background color for UIActivityIndicatorView

I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as well as some text besides the indicator.

I am wondering whether there is any existing component to do that task, or I have to implement my own class to perform that task.

Any suggestion are highly welcome, thanks in advance.

like image 787
BlueDolphin Avatar asked Dec 01 '22 13:12

BlueDolphin


1 Answers

If you just want a different background color of your UIActivityIndictatorView, you could just send the setBackgroundColor message to the object, i.e.:

[activityIndicator setBackgroundColor:[UIColor blackColor]];

By the way, you can change the size of the indicator as well. just do setFrame or initWithFrame with a bigger rect. Remember UIActivityIndicatorView inherits from UIView so you get all the customization of UIView.

like image 99
leonho Avatar answered Dec 05 '22 23:12

leonho