做了一些谷歌上搜索周围看到的iOS 7如何添加一个UITableView到UIAlertView中在iOS的7
该子视图不再支持一些PPL建议创建自定义视图,但我不知道我怎么能做到这一点。
这是我的代码,任何人都可以指向正确的方向吗?
-(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];
}
从链接,谢谢,我看到有这个东西叫UIActionSheet https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UIActionSheet.html#//apple_ref/doc/uid/TP40012857-UIActionSheet-SW1 看起来很有趣 – f00pman
是啊,这是人们也在使用一种解决方案。但是如果你继承UIViewController来模仿UIAlertView,那么它也不是一个非常糟糕的主意。看看Github,看看有没有人做到了。 –
https://github.com/wimagguc/ios-custom-alertview – LoungeKatt