小编f00*_*man的帖子

如何在iOS 7中将UITableView添加到UIAlertView中

做了一些谷歌搜索看到iOS 7不再支持子视图.

一些人建议创建自定义视图,但我不知道我该怎么做.

这是我的代码,有人能指出我正确的方向吗?

-(IBAction)click_select_fruit_type
{
select_dialog = [[[UIAlertView alloc] init] retain];
[select_dialog setDelegate:self];
[select_dialog setTitle:@"Fruit Type"];
[select_dialog setMessage:@"\n\n\n\n"];
[select_dialog addButtonWithTitle:@"Cancel"];

idType_table = [[UITableView alloc]initWithFrame:CGRectMake(20, 45, 245, 90)];
idType_table.delegate = self;
idType_table.dataSource = self;
[select_dialog addSubview:idType_table];

[idType_table reloadData];

[select_dialog show];
[select_dialog release];

}
Run Code Online (Sandbox Code Playgroud)

uitableview uialertview ios7

3
推荐指数
1
解决办法
9910
查看次数

标签 统计

ios7 ×1

uialertview ×1

uitableview ×1