public class NativeAdLayout
extends com.facebook.ads.internal.api.AdComponentFrameLayout
To create an Ad using this wrapper, create a NativeAdLayout and add your current ad layout as the root element. Since NativeAdLayout is simply a FrameLayout, you can add your current layout as is.
Then, when creating the AdOptionsView
, make sure to pass the NativeAdLayout
in the constructor.
When rendering the ad, you can check that everything is working properly by clicking on the Ad Choices button. If the NativeAdLayout was passed, we will render an overlay on top of the ad with the reporting options. Otherwise, or if the ad is too small, it will open a website.
Constructor and Description |
---|
NativeAdLayout(Context context) |
NativeAdLayout(Context context,
AttributeSet attrs) |
NativeAdLayout(Context context,
AttributeSet attrs,
int defStyleAttr) |
NativeAdLayout(Context context,
com.facebook.ads.internal.api.NativeAdLayoutApi nativeAdLayoutApi)
Used by other SDK classes and subject to change.
|
Modifier and Type | Method and Description |
---|---|
com.facebook.ads.internal.api.NativeAdLayoutApi |
getNativeAdLayoutApi()
Used by other SDK classes and subject to change.
|
void |
setMaxWidth(int maxWidth) |
void |
setMinWidth(int minWidth) |
public NativeAdLayout(Context context)
public NativeAdLayout(Context context, AttributeSet attrs)
public NativeAdLayout(Context context, AttributeSet attrs, int defStyleAttr)
public NativeAdLayout(Context context, com.facebook.ads.internal.api.NativeAdLayoutApi nativeAdLayoutApi)