Question

I have created a uialertview

UIAlertView *alert = [[UIAlertView alloc]
                                initWithTitle:@"Prohibited"
                                message:@"In-App Purchase is disabled, cannot make a purchase!"
                                delegate:self
                                cancelButtonTitle:nil
                                otherButtonTitles:@"Ok", nil];
[alert show];

Which creates a dialog as below

enter image description here

But I need something like

enter image description here

How do I get this glossy look and feel ? Working in iOS 7.1, xocode 5.

My app uses UIWebView, UIViewController

Was it helpful?

Solution

It will look glossy as seen in that image on iOS 6 and lower OSs. iOS 7 is now flat.

Now if you wish to create your own UIAlertView by subclassing it. Theres a few tutorials that will teach you how to. but you'll need to create your own graphics and will cause a extra programming.

All your custom drawing will have to be inside the drawRect or overriding the various elements in the UIAlertView.

I would look at the way this github project does it's own customization to the UIAlertView https://github.com/Sumi-Interactive/SIAlertView

For example:

enter image description here

OTHER TIPS

The non glossy UI goes with IOS 7, I have an old app which has IOS 6 as the target version - it has the glossy alert views in an IOS 6 device (iPhone 3GS) but once running in an IOS 7 device it follows the new format., If it is really important you may want to simulate UIAlertviews using modal subviews .... [self presentViewController: mediaUI animated: YES completion:NULL]; or pop view controllers if coding for iPad.

Here is an old sample code : https://github.com/TomSwift/TSAlertView

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