Question

Foursquare uses a customised alert (like the attached image). I'm trying to get the same look and feel, rounded corners, fade in and fade out effect, etc. I'm looking around but all the solutions I found seems to over complicate something simple, like:

http://joris.kluivers.nl/blog/2009/04/23/subclass-uialertview-to-create-a-custom-alert/

Am I in the right path? Should I use some custom view class that I don't know about? Should I write my own?

Image

Was it helpful?

Solution

The approach you linked is fine. They probably subclassed UIAlertView to get the same "dim" effect when the alert pops up (see their screenshots). Foursquare doesn't have that dim effect (in your image). They probably simply subclassed UIView and added it as a subview to the UIWindow of the app.

OTHER TIPS

If the subclass that's already written works, why not? If not, it seems like all they're doing in that blog post you pasted in your post is override the drawRect method to draw their own graphics. If you're comfortable doing that on your own, it's a possibility.

Have a look at MBProgressHUD: https://github.com/jdg/MBProgressHUD

This HUD can be customised with images:

    HUD.customView = customImage; // UIImageView
    HUD.mode = MBProgressHUDModeCustomView;

Regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top