开发者

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开发者_Go百科]
               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];


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.


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.


you can use uitextfield to do so ,

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜