Teddy13
Teddy13

Reputation: 3854

Adding a UILabel or NSString to UIalertView

I would like to add a bunch of UILabels or NSStrings to the UIALertView since I have run out of space on my display.

UIAlertView *alertDialog;
alertDialog = [[UIAlertView alloc]
               initWithTitle:@"random" message:nil delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles: nil];


//firstString=[[UILabel alloc]initWithFrame: CGRectMake(12.0, 70.0, 260.0, 25.0)];

[alertDialog addSubview:firstString];
[alertDialog show];
[alertDialog release];

Upvotes: 0

Views: 1304

Answers (3)

chings228
chings228

Reputation: 1889

you can use uitextfield to do so ,

simply change textcolor to while , and change background color to clearColor

Upvotes: 0

vikingosegundo
vikingosegundo

Reputation: 52237

You can use a alternative implementation of an alert view. One, that is not a subclass of UIAlertView — so it is absolutely independent to any changes Apple may release. And you have the possibility to add any subview as a clean property.

TSAlertView is such an alternative implementation.

Upvotes: 1

zaph
zaph

Reputation: 112873

I can tell you from experience that this is a bad idea. In earlier version or iOS there were tricks using undocumented behavior, Apple made changes to the underlaying code and it all broke badly. Just create a UIView the way you like. If you want to dim the rest of the screen just place a semi-transparenr view over the screen and under your view.

Upvotes: 3

Related Questions