我正在处理 AppLovin Max 的原生广告,并想编辑 AppLovin Max 原生广告布局的布局.....
我得到的布局是这样的...... 原生广告布局
我想要的是编辑这个广告布局......
private fun createNativeAdSplash() {
val nativeAdContainer = findViewById<FrameLayout>(R.id.native_splash_m)
nativeAdContainer!!.setBackgroundResource(R.drawable.ad_border)
nativeAdLoader = MaxNativeAdLoader(sharedPref!!.getNativeAdId(), this)
nativeAdLoader!!.setNativeAdListener(object : MaxNativeAdListener() {
override fun onNativeAdLoaded(nativeAdView: MaxNativeAdView, ad: MaxAd) {
// Clean up any pre-existing native ad to prevent memory leaks.
if (nativeAd != null) {
nativeAdLoader!!.destroy(nativeAd)
}
// Save ad for cleanup.
nativeAd = ad
// Add ad view to view.
nativeAdContainer.removeAllViews()
nativeAdContainer.addView(nativeAdView)
}
override fun onNativeAdLoadFailed(adUnitId: String, error: MaxError) {
// We recommend retrying with exponentially higher delays up to a maximum delay
const_splash_ad.visibility = View.INVISIBLE
}
override fun onNativeAdClicked(ad: MaxAd) {
nativeAdLoader!!.destroy(nativeAd)
createNativeAdSplash()
// Optional click callback
}
})
nativeAdLoader!!.loadAd()
}