Question about ad-mob location.

Asked 1 years ago, Updated 1 years ago, 68 views

After developing the Android app, I attached an ad-mob. During the test, I have a question because the ad-mob position is different on the Galaxy Note 5.

First of all, this is the question screen.

This is where the ad-mob is located on the layout.

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start"
    xmlns:ads="http://schemas.android.com/apk/res-auto">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.google.android.gms.ads.AdView
            android:id="@+id/adView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            ads:adSize="SMART_BANNER"
            ads:adUnitId="@string/banner_ad_unit_id_choice"/>
    </RelativeLayout>
    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

</android.support.v4.widget.DrawerLayout>

Why is it coming out like this? It is well positioned on other phones (Gal 4, 5, 7, Galaxy Note 4, LG cat 6, etc.).

android admob layout

2022-09-22 21:11

1 Answers

Please try debugging with "Settings > Developer Options > Display Layout Scope". On the code, the layout doesn't seem to be arranged strangely. It is assumed that the banner image does not fill up the actual area and appears to be Center horizontal, Top Vertical, so a phenomenon such as a screen shot occurs.

I recommend you to apply the method below.


2022-09-22 21:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.