我想用從FBNativeAdView
預建視圖(不希望自定義FBNative廣告)在linkIOS Facebook添加FBNativeAdView作爲子視圖
的FBNativeAdView。至於給創建預置的原生廣告模板的意見和 管理原生廣告。
而且我也改變了NativeAdSample例如Facebook SDK給出。而添加FBNativeAdView
爲MAINVIEW(adUIView)的一個子視圖。
-(void) nativeAdDidLoad: (FBNativeAd *) nativeAd
{
NSLog(@"Native ad was loaded, constructing native UI...");
if (self._nativeAd)
{
[self._nativeAd unregisterView];
}
self._nativeAd = nativeAd;
// Here I did add
FBNativeAdViewAttributes * attributes = [[FBNativeAdViewAttributes alloc] init];
attributes.backgroundColor = [UIColor whiteColor];
attributes.titleColor = [UIColor blackColor];
FBNativeAdView * fbNativeAdView = [FBNativeAdView nativeAdViewWithNativeAd: self._nativeAd withType: FBNativeAdViewTypeGenericHeight300 withAttributes: attributes];
}
所以,問題是如何添加fbNativeAdView
作爲ParentView的子視圖,所以應該查看父view.I做到了
[self.adUIView addSubview:fbNativeAdView];
沒有成功。
Native Ad Template給出了有關如何從FBNativeAd
得到FBNativeAdView
的信息。但沒有告知如何在uiview中使用FBNativeAdView
。
「沒有成功」 - >發生了什麼事?任何錯誤/通知? – Roemer
只有白色的背景視圖。 –
我也一樣...只是背景(我可以設置顏色),但沒有其他內容。這些例子甚至沒有使用FBNativeAdView – Marco