Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.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
IOS-添加颜色选择器子视图时变暗父视图_Ios_Iphone_Facebook Messenger - Fatal编程技术网

IOS-添加颜色选择器子视图时变暗父视图

IOS-添加颜色选择器子视图时变暗父视图,ios,iphone,facebook-messenger,Ios,Iphone,Facebook Messenger,[选取器颜色视图][1] 我想做一个视图(如下面截图中的一个)。当选择器视图显示时,后面的屏幕会像照片一样褪色。 谢谢你的帮助 我相信实现这一目标并不难 首先,创建一个名为ColorPickerView的UIView,并向其中添加一些带有自定义图像的按钮(在您的示例中,是带有不同颜色的圆圈)。然后添加Cancel按钮,以便用户可以通过点击它来删除(使用removeFromSuperView)ColorPickerView。最后,添加一个UILabel来表示ColorPickerView的标题

[选取器颜色视图][1]

我想做一个视图(如下面截图中的一个)。当选择器视图显示时,后面的屏幕会像照片一样褪色。
谢谢你的帮助

我相信实现这一目标并不难

首先,创建一个名为
ColorPickerView
的UIView,并向其中添加一些带有自定义图像的按钮(在您的示例中,是带有不同颜色的圆圈)。然后添加
Cancel
按钮,以便用户可以通过点击它来删除(使用removeFromSuperView)
ColorPickerView
。最后,添加一个UILabel来表示
ColorPickerView
的标题

当显示
ColorPickerView
时,您应该在mainPageView(位于
ColorPickerView
后面的屏幕)上添加一个视图。让我们称之为
blurView
。将
blurView
的背景色设置为黑色,alpha设置为0.3(由您选择)。同样,当要删除
ColorPickerView
时,您也应该删除
blurView


您可以通过
Cancel
按钮删除
blurView

如果没有其他问题,请考虑接受我的答案:)