애드몹 위치관련 질문입니다.
조회수 2554회
안드로이드 앱을 개발 후 애드몹을 달았습니다. 테스트 도중 갤럭시 노트5에서 애드몹 위치가 다르게 잡혀 질문드립니다.
우선 문제 화면 입니다.
이게 레이아웃상에서 애드몹을 위치 시킨 곳입니다.
<?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>
왜 이렇게 나올까요 다른 폰들 (갤4, 5, 7, 갤노트4, lg cat6 등)에서는 잘 위치하였습니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
"설정 > 개발자 옵션 > 레이아웃 범위 표시"로 디버깅을 해보시기 바랍니다. 코드 상으로는 레이아웃이 이상하게 배치될 부분은 없어보이고요. 배너 이미지가 실제 영역을 꽉 채우지 않고 Center horizontal, Top Vertical로 보여서 스크린샷과 같은 현상이 발생하는게 아닌가 추측됩니다.
관련해서 아래 방법도 적용해보시길 추천드려요.
-
(•́ ✖ •̀)
알 수 없는 사용자
- 이유를 알아냈습니다. 노트5 화면 크기 때문에 SMART_BANNER 옵션이 자동으로 height값을 90dp 할당해서 그랬던거네요 https://groups.google.com/forum/#!topic/google-admob-ads-sdk/wwxw9EpZBKY 알 수 없는 사용자 2016.8.11 11:44
-
댓글 입력