Yes, you can but should not modify the look of UIAlertView
since Apple hates that shit.
Instead, create your own UIView
that mimics the alertView
.
Also... does the initWithFrame
method even make a difference?
Example... Try:
UIAlertView *alert = [[UIAlertView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
It won't make a difference.
So... I'd suggest:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Notes"
message:nil
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Add Note",@"Show Notes",nil];
[alert setTag:TAG_ALERT0];
[alert show];
But since you asked for sample code, the following example will be simple and to the point:
STATUTORY WARNING:
- Apple doesn't like this
- Doesn't work in iOS7
Example:
-(void)willPresentAlertView:(UIAlertView *)alertView
{
UILabel *theTitle = [alertView valueForKey:@"_titleLabel"];
[theTitle setTextColor:[UIColor orangeColor]];
NSMutableArray *arrButtons = [alertView valueForKey:@"_buttons"];
for (UIView *vwCurrent in arrButtons) {
[vwCurrent setBackgroundColor:[UIColor redColor]];
}
}