简体   繁体   中英

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. 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

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

  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

  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

Use this layout to make adView like list view this my xml file

<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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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