Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.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_Ipad_Uiview_Mask_Cgpath - Fatal编程技术网

Ios 在视网膜上应用图层遮罩会隐藏所有内容

Ios 在视网膜上应用图层遮罩会隐藏所有内容,ios,ipad,uiview,mask,cgpath,Ios,Ipad,Uiview,Mask,Cgpath,我有一个应用图层蒙版的UIView。它在除iPad以外的所有设备上都能正常工作。在视网膜iPad上,被遮罩的视图没有显示出来。如果我取下遮罩,视图就会显示在iPad上 面具很简单。它显示了除从底部边缘取出的小三角形以外的整个视图 contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] applicationFrame].size.width, [[UIScreen mainScreen

我有一个应用图层蒙版的UIView。它在除iPad以外的所有设备上都能正常工作。在视网膜iPad上,被遮罩的视图没有显示出来。如果我取下遮罩,视图就会显示在iPad上

面具很简单。它显示了除从底部边缘取出的小三角形以外的整个视图

contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] applicationFrame].size.width, [[UIScreen mainScreen] applicationFrame].size.height - 50.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
CGMutablePathRef path = CGPathCreateMutable();
float triangleDepth = 10;
CGPathMoveToPoint(path, NULL, 0, 0);
CGPathAddLineToPoint(path, NULL, contentView.frame.size.width, 0);
CGPathAddLineToPoint(path, NULL, contentView.frame.size.width, contentView.frame.size.height);
CGPathAddLineToPoint(path, NULL, (contentView.frame.size.width / 2.0) + triangleDepth, contentView.frame.size.height);
CGPathAddLineToPoint(path, NULL, (contentView.frame.size.width / 2.0), contentView.frame.size.height - triangleDepth);
CGPathAddLineToPoint(path, NULL, (contentView.frame.size.width / 2.0) - triangleDepth, contentView.frame.size.height);
CGPathAddLineToPoint(path, NULL, 0, contentView.frame.size.height);
CGPathCloseSubpath(path);
[maskLayer setPath:path];
CGPathRelease(path);
contentView.layer.mask = maskLayer;
contentView.clipsToBounds = NO;
[self.view addSubview:contentView];

这段代码适用于每台设备,因此retina iPad有什么不同之处可以阻止它工作?

这只是iOS模拟器的一个问题。我终于在retina iPad上试用了该代码,一切正常。

这只是iOS模拟器的一个问题。我终于在retina iPad上尝试了这段代码,一切都很顺利