如何在iPhone中的UIAlertView中添加UITableView?

Pug*_*gal 6 iphone uitableview alertview

我想在警报视图中添加UItableview.

我试图添加一个表视图作为警报视图的子视图,它不起作用.你能给我一些代码或示例链接吗?

我怎样才能做到这一点?

谢谢

Kar*_*yan 10

尝试以下任何一个页面:

http://zpasternack.blogspot.com/2010/10/stupid-uialertview-tricks-part-deux.html

https://github.com/blommegard/SBTableAlert

  • 2个死链接和其他2个移动.这就是为什么你应该在答案中添加代码,而不仅仅是链接. (2认同)

小智 5

它在我的案例中工作

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:@"click for submission \n\n\n\n "delegate:self  cancelButtonTitle:@"click for submission"
otherButtonTitles:nil];

    table = [[UITableView alloc]initWithFrame:CGRectMake(10, 40, 264, 120)];
    table.delegate = self;
    table.dataSource = self;
    [alert addSubview:table];

    [alert show];

    [table release];

    [alert release];        
Run Code Online (Sandbox Code Playgroud)