我想用从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