Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在iPhone上制作一个不完全覆盖底层屏幕的新屏幕_Iphone_Ios_Uiviewcontroller - Fatal编程技术网

如何在iPhone上制作一个不完全覆盖底层屏幕的新屏幕

如何在iPhone上制作一个不完全覆盖底层屏幕的新屏幕,iphone,ios,uiviewcontroller,Iphone,Ios,Uiviewcontroller,我有几个输入屏幕,用户按下一个按钮,当前打开另一个选择器屏幕,屏幕上有一个选择器和几个按钮 我希望选择器屏幕显示在输入屏幕上方,而不是将选择器屏幕显示为完全覆盖输入屏幕的全新屏幕 就像一个较小的屏幕,居中,变灰,无法访问 只要显示选择器屏幕,基本的输入屏幕 目前,输入屏幕和选择器屏幕是通过UIViewController实现的。。。而选择器屏幕完全取代了输入屏幕 是否有一种简单的方法来更改选择器屏幕,使其显示在输入屏幕的顶部? 非常感谢制作一个UIView,其上的picker视图的大小为u所需。

我有几个
输入屏幕
,用户按下一个按钮,当前打开另一个
选择器屏幕,屏幕上有一个选择器和几个按钮

我希望
选择器屏幕
显示在
输入屏幕
上方,而不是将
选择器屏幕
显示为完全覆盖
输入屏幕的全新屏幕

就像一个较小的屏幕,居中,变灰,无法访问 只要显示
选择器屏幕
,基本的
输入屏幕

目前,
输入屏幕
选择器屏幕
是通过UIViewController实现的。。。而
选择器屏幕
完全取代了
输入屏幕

是否有一种简单的方法来更改选择器屏幕,使其显示在输入屏幕的顶部?


非常感谢

制作一个UIView,其上的picker视图的大小为u所需。并在view 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];
像这样添加选择器。
`

制作一个UIView,其上的选取器视图的大小为u所需。然后在视图DidLoad中隐藏该视图。当按下所需按钮时,取消隐藏该视图。然后根据需要将其隐藏。这非常简单。否则,根据需要调整选取器视图的大小`

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];
像这样添加选择器。
`

谢谢-但这不会使基础屏幕变灰,而且基础屏幕元素的所有其他元素仍然可以访问…做一件事…制作一个全尺寸的灰色图像背景视图。并具有透明部分,在其中添加选择器和所有其他东西,然后添加picker视图和所有Buuton到该视图中。按照我所说的做。因此背景将变为灰色。如果需要,我将给您代码以生成透明视图…查看编辑后的答案。这样,您需要添加所有控件…我理解您的方法,但这也不会使底层元素无法访问,我必须将pickerScreen的所有代码(基本上是所有按钮)都放进去在输入屏幕中-所有这些我都在努力避免-如果没有办法使选择器屏幕看起来像我描述的那样-我宁愿保持现在的样子-非常感谢,尽管看到编辑过的答案。这将为你带来诀窍。仍然你不会得到只有上帝可以帮助乌坦克斯-但这不会使底层屏幕和所有其他屏幕变灰基本屏幕元素的元素仍然可以访问…做一件事…制作一个全尺寸视图的灰色图像背景。并具有透明部分,在其中添加选择器和所有其他东西,然后添加picker视图和所有Buuton到该视图中。按照我所说的做。因此背景将变为灰色。如果需要,我将给您代码以生成透明视图…查看编辑后的答案。这样,您需要添加所有控件…我理解您的方法,但这也不会使底层元素无法访问,我必须将pickerScreen的所有代码(基本上是所有按钮)都放进去在输入屏幕中-我试图避免所有这些-如果没有办法使选择器屏幕看起来像我描述的那样-我宁愿保持它现在的样子-非常感谢,尽管看到编辑过的答案。这将为你带来诀窍。但你仍然得不到只有上帝可以帮助你