使用选择器视图制作一个 UIView,其大小符合您的要求。并在视图 DidLoad 中隐藏该视图。当按下所需按钮时,取消隐藏该视图。然后在您需要后将其隐藏。它是如此简单。否则调整根据需要调整 Pickerview 的大小。
UIView *whiteCoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
whiteCoverView.alpha = 0.9;
whiteCoverView.tag = 999;
whiteCoverView.backgroundColor = [UIColor grayColor];
[self.view addSubview:whiteCoverView];
UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 25, 320, 40)];
label2.backgroundColor = [UIColor clearColor];
label2.numberOfLines = 0;
label2.font = [UIFont boldSystemFontOfSize:15.0];
label2.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
label2.textAlignment = UITextAlignmentCenter;
label2.textColor = [UIColor whiteColor];
label2.text = @"cfff";
[whiteCoverView addSubview:label2];
[label2 release];
int gap = 10;
UILabel *label3a = [[UILabel alloc] initWithFrame:CGRectMake(20, gap+50, 280, 15)];
label3a.backgroundColor = [UIColor clearColor];
label3a.numberOfLines = 0;
label3a.font = [UIFont boldSystemFontOfSize:13.0];
label3a.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
label3a.textAlignment = UITextAlignmentCenter;
label3a.textColor = [UIColor whiteColor];
label3a.text = @"cfccc ";
[whiteCoverView addSubview:label3a];
[label3a release];
像这样添加选择器。`