views:

154

answers:

4

Does anyone know how to show a rounded squared with a spinning activity indicator? It is used in many apps. If you don't know what im talking about, it looks like the indicator when you change volume on your Mac but with a darker background. Im not sure if it is built-in to iOS or someone made it.

Like the one in this post but not full screen just the activity indicator http://stackoverflow.com/questions/2114231/how-to-create-a-full-screen-modal-status-display-on-iphone

+1  A: 

Read this.

http://developer.apple.com/iphone/library/documentation/uikit/reference/UIActivityIndicatorView_Class/Reference/UIActivityIndicatorView.html

Gary
I've read this. This is not it
Yazzmi
Do you have a screenshot of what you want? That class does what you describe if you set the style appropriately.
Gary
Like the one in this post but not full screen just the activity indicator http://stackoverflow.com/questions/2114231/how-to-create-a-full-screen-modal-status-display-on-iphone
Yazzmi
+1  A: 

One option: MBProgressHUD.

jtbandes
A: 

You're actually looking at using two UIView subclasses and a custom .png image to get the look you want. The Gray translucent box would be a UIImageView object, to get the effect you're looking for you need a .png file of a grey square with rounded corners, it doesn't need to be the final size, as long as there's at least one pixel of straight edge between the corners it will work fine. You'll then load it in as a UIImage with the UIImage stretchableImageWithLeftCapWidth:topCapHeight: method, this let's you specify the top, and left portions of the image that must stay the same, and a 1 pixel slice in each direction will be stretched out to fill the UIImage view you use the image in. http://www.bit-101.com/blog/?p=2275 has a great example of how this works. So create a UIImage, then create a UIImageView using this image, set its opaque property to NO and the alpha property to something that looks good to you. Add this a subview of your current view. Now you just need to add the spinning progress indicator, this is even easier, just create a new UIActivityIndicatorView and add it as a subview of the UIImageView you've already created. The same basic method is used to create pretty much any resizable element in an iOS application. There's some examples of using them for buttons in Apple's UICatalog example code.

Shinohara
A: 

Your screenshot is probably a usage of David Sinclair's DSActivityView module. Specifically, the DSBezelActivityView component of it. Or if not, it's a close copy.

http://www.dejal.com/developer/dsactivityview

I use DSActivityView all the time. Great library. Toss that thing up while pulling down data, keeps users and clients happy.

Dan Ray