简体   繁体   English

iPhone renderInContext没有捕获iAd

[英]iphone renderInContext not capturing iAd

I have managed to add an iAd to a table cell which is working as expected. 我设法将iAd添加到工作正常的表格单元中。 When the user taps a table cell I want to perform a specific animation, so I captured the view using the code below into a UIImage then transform the image. 当用户点击表格单元格时,我想执行特定的动画,因此我使用下面的代码捕获了视图到UIImage中,然后转换了图像。 This works perfectly apart form the fact that the captured image contains everything appart from the iAd. 这与捕获的图像包含iAd的所有内容的事实完全不同。 I have swapped iAds for AdMob and it works fine, so must be something to do with the way an iAd is attached to the view tree. 我已经将iAd替换为AdMob,并且效果很好,因此必须与iAd附加到视图树的方式有关。 Any one have any ideas on how to capture the iAd image. 任何人都对如何捕获iAd图像有任何想法。

CGRect rect = view.bounds;  
UIGraphicsBeginImageContext(rect.size);  
CGContextRef context = UIGraphicsGetCurrentContext();  
[view.layer.superlayer renderInContext:context];  
UIImage *imageCaptureRect;    
imageCaptureRect = UIGraphicsGetImageFromCurrentImageContext();  
self.capturedImage = imageCaptureRect;
UIGraphicsEndImageContext();  

I would hazard a guess that this is by design. 我可能会猜测这是设计使然。 Apple uses the personal information they have on their users and their account histories to target iAds to the correct demographics. 苹果使用他们在用户和帐户历史上拥有的个人信息将iAd定位到正确的人口统计信息。 If Apple allowed developers to determine which iAds a user was receiving, they would be leaking this personal information. 如果Apple允许开发人员确定用户正在接收哪些iAd,则他们将泄漏此个人信息。 Consider the possibility that an iAd was targeted to people under the age of 30. An application that captured your iAds could watch out for this advert and determine your age bracket. 考虑将iAd定位到30岁以下人群的可能性。捕获了iAd的应用程序可以注意该广告,并确定您的年龄段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM