0

我正在尝试展示 Facebook 原生广告模板,但没有成功。

class ViewController: UIViewController, FBNativeAdDelegate
{
    override func viewDidLoad()
   {
        super.viewDidLoad()

        facebookAdViewContainer.backgroundColor = UIColor.greenColor()
        let nativeAd = FBNativeAd(placementID: <id>)
        nativeAd.delegate = self
        nativeAd.loadAd()
        ...
   }

   func nativeAdDidLoad(nativeAd: FBNativeAd) 
   {
       let attributes = FBNativeAdViewAttributes()
       attributes.backgroundColor = UIColor.blueColor()
       let adview = FBNativeAdView(nativeAd: nativeAd, withType:FBNativeAdViewType.GenericHeight300)//, withAttributes: attributes)
       adview.hidden = false
       self.topBannerViewContainer.addSubview(adview)
   }
...
}

正如您在图片中看到的,广告没有展示。至少我希望看到广告的蓝色背景,但我只能看到容器的绿色背景

在此处输入图像描述

4

0 回答 0