I need a UIALertView, which on popping up should be transparent enough to show the background behind the alertview in a faded way and the blue color of the alert view should not appear since the background behind the alert view is black and grey in color. Changing color and putting an image to the alert view is one thing which can be seen in the links : iOS 5 black transparent UIAlertView and Changing the background color of a UIAlertView?
but I need a transparent UIAlertView. Is it possible to get one?If yes how?
Thanks for the help in advance.

- 1
- 1

- 66
- 9
-
nope dear...everything remained the same,the blue color of the alert view also remains..!! – keepsmiling Sep 03 '12 at 11:20
-
do u want to remove the blue color ...? – Arun Sep 03 '12 at 12:54
-
have u used that .... UIImage *theImage =nil;// [UIImage imageNamed:@"fliperSample2.png"]; still your getting the blue... – Arun Sep 03 '12 at 12:58
3 Answers
If you look at Apple's documentation page for UIAlertView you'll see this note:
The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.
In other words, Apple doesn't want developers to muck around with colors or fonts or backgrounds when it comes to UIAlertView. If Apple changes the internal guts of UIAlertView in a later iOS, your app is likely to have unexpected and not-desired effects when that modified alert appears.
If you want custom UIAlertView like behavior, why not just write your own UIView that looks and behaves a lot like UIAlertView. And then you have full control over everything about how it's drawn.

- 88,797
- 17
- 166
- 215
-
so you mean custom UIAlertView...right..??..but then how to make it transparent..!!..??..please help if such a thing can be possible..!! – keepsmiling Sep 03 '12 at 11:03
As Michael said, you can't with an UIAlertView, you have to build it yourself.
You can try BlockAlertsAnd-ActionSheets, it is like a customizable UIAlerView https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets

- 51,328
- 11
- 132
- 176
-
i tried this, but the alertview there too did not become transparent...anyways,thanks for the advice..!! :) – keepsmiling Sep 03 '12 at 11:01
I know it's too late but, I'll leave this command for other developers.
.h
@interface CustomAlertView:UIAlertView {}
.m
// override
- (void)drawRect:(CGRect)rect
{
for(UIView * sub in self.subviews)
{
[sub removeFromSuperview];
}
// this removeFromSuperview will clear all thing such as background view and buttons
// do something
}

- 481
- 3
- 7