简体   繁体   English

Admob原生高级广告尺寸

[英]Admob Native Advanced Ads sizes

I am implementing that kind of ads in my app. 我正在我的应用程序中实施这种广告。 I want to know which height I can use for that. 我想知道可以使用哪个高度。 I found several examples by Admob with ads, but for my app heights in those examples too big. 我发现Admob带有广告的几个示例,但是对于这些示例中我的应用程序高度而言,太大了。 So, I want to know what;s the minimum height and which items I can do not display within the ad 因此,我想知道最小高度是多少,我不能在广告中显示哪些项目

Native Ads Advanced is currently in a closed beta but we have access to use that Native Ads Advanced目前处于封闭测试阶段,但我们可以使用它

For Native ads Advanced,please check field Descriptions page where all the field with their type and Required to be displayed? 对于高级原生广告,请检查字段描述页面,其中将显示所有字段及其类型和必填? etc. are maintained. 等等。

Native ads advanced field descriptions 原生广告高级字段描述

Please check screenshot :' 请检查屏幕截图:' 在此处输入图片说明

在此处输入图片说明

原生广告的最小和最大宽度和高度

  1. if you want small native ad your Min width should be 280, Max width 1200 and Min height should be 80, Max height should be 612 如果您想使用小型原生广告,则最小宽度应为280,最大宽度应为1200,最小高度应为80,最大高度应为612

  2. if you want Medium native ad your Min width should be 280, Max width 1200 and Min height should be 132, Max height should be 1200 如果您要使用中级原生广告,则最小宽度应为280,最大宽度应为1200,最小高度应为132,最大高度应为1200

  3. if you want Large native ad your Min width should be 280, Max width 1200 and Min height should be 250, Max height should be 1200 visit here for more detail 如果您想使用大型原生广告,则最小宽度应为280,最大宽度应为1200,最小高度应为250,最大高度应为1200。 有关详情,请访问此处

Use this layout to make adView like list view this my xml file 使用此布局使adView像列表一样查看此xml文件

<com.google.android.gms.ads.formats.UnifiedNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:background="#FFFFFF"
    android:minHeight="50dp"
    android:orientation="vertical">

    <TextView style="@style/AppTheme.AdAttribution"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="3dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/ad_app_icon"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:src="@mipmap/ic_launcher_round"
                android:adjustViewBounds="true"
                android:paddingBottom="5dp"
                android:paddingEnd="5dp"
                android:paddingRight="5dp"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/ad_headline"
                    android:text="asjkakjsjkah"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="#0000FF"
                    android:textSize="16sp"
                    android:textStyle="bold" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/ad_advertiser"
                        android:text="alkshalkslkajslakjl"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="bottom"
                        android:textSize="14sp"
                        android:textStyle="bold"/>

                    <RatingBar
                        android:id="@+id/ad_stars"
                        style="?android:attr/ratingBarStyleSmall"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:isIndicator="true"
                        android:numStars="5"
                        android:stepSize="0.5" />

                    <Button
                    android:id="@+id/ad_call_to_action"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textSize="12sp" />
                </LinearLayout>

            </LinearLayout>
        </LinearLayout>

        <!--<LinearLayout-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:orientation="vertical">-->

            <!--<TextView-->
                <!--android:id="@+id/ad_body"-->
                <!--android:layout_width="wrap_content"-->
                <!--android:layout_height="wrap_content"-->
                <!--android:layout_marginRight="20dp"-->
                <!--android:layout_marginEnd="20dp"-->
                <!--android:textSize="12sp" />-->

            <!--<ImageView-->
                <!--android:id="@+id/ad_image"-->
                <!--android:layout_width="250dp"-->
                <!--android:layout_height="175dp"-->
                <!--android:layout_gravity="center_horizontal"-->
                <!--android:layout_marginTop="5dp" />-->

            <!--<com.google.android.gms.ads.formats.MediaView-->
                <!--android:id="@+id/ad_media"-->
                <!--android:layout_gravity="center_horizontal"-->
                <!--android:layout_width="250dp"-->
                <!--android:layout_height="175dp"-->
                <!--android:layout_marginTop="5dp" />-->

            <!--<LinearLayout-->
                <!--android:layout_width="wrap_content"-->
                <!--android:layout_height="wrap_content"-->
                <!--android:layout_gravity="end"-->
                <!--android:orientation="horizontal"-->
                <!--android:paddingBottom="10dp"-->
                <!--android:paddingTop="10dp">-->

                <!--<TextView-->
                    <!--android:id="@+id/ad_price"-->
                    <!--android:layout_width="wrap_content"-->
                    <!--android:layout_height="wrap_content"-->
                    <!--android:paddingLeft="5dp"-->
                    <!--android:paddingStart="5dp"-->
                    <!--android:text="100"-->
                    <!--android:paddingRight="5dp"-->
                    <!--android:paddingEnd="5dp"-->
                    <!--android:textSize="12sp" />-->

                <!--<TextView-->
                    <!--android:id="@+id/ad_store"-->
                    <!--android:layout_width="wrap_content"-->
                    <!--android:layout_height="wrap_content"-->
                    <!--android:paddingLeft="5dp"-->
                    <!--android:paddingStart="5dp"-->
                    <!--android:text="100rs"-->
                    <!--android:paddingRight="5dp"-->
                    <!--android:paddingEnd="5dp"-->
                    <!--android:textSize="12sp" />-->

                <!--<Button-->
                    <!--android:id="@+id/ad_call_to_action"-->
                    <!--android:layout_width="wrap_content"-->
                    <!--android:layout_height="wrap_content"-->
                    <!--android:gravity="center"-->
                    <!--android:textSize="12sp" />-->
            <!--</LinearLayout>-->
        <!--</LinearLayout>-->
    </LinearLayout>
</LinearLayout>

get these views in code first set the all views then assign them this will looks like list Ad 在代码中获取这些视图,首先设置所有视图,然后分配给它们,这将类似于列表广告

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM