내 앱의 하단에 AdView를 배치하려고합니다. 그러나 앱을 테스트 할 때 광고 나 AdView가 표시되지 않습니다.AdView가 앱 하단에 표시되지 않습니다.
내 MainActivity에서 2 FrameLayouts를 2 조각으로 바꿉니다. 따라서 AdView는 세 번째 조각 뒤에 표시되어야합니다.
여기 여기 CardListView 조각에 의해 사용되는 레이아웃의 내 main_activity.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_id"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@+id/fragment_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/fragment_content2"
android:layout_width="fill_parent"
android:layout_height="500dp" />
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="app_id"/>
</LinearLayout>
Main_activity.java
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("5554:Perfect_One")
.build();
// Start loading the ad in the background.
adView.loadAd(adRequest);
myContext = this;
fragmentManager = this.getFragmentManager();
Fragment frag = new SortFeature();
FragmentTransaction ft = fragmentManager.beginTransaction();
ft.replace(R.id.fragment_content, frag);
ft.commit();
Fragment frag2 = new CardListView();
FragmentTransaction ft2 = fragmentManager.beginTransaction();
ft2.replace(R.id.fragment_content2, frag2);
ft2.commit();
입니다.
09-08 21:22:29.578: I/Ads(2050): JS: Creating Application Cache with manifest http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache (http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html:0)
09-08 21:22:29.588: I/chromium(2050): [INFO:CONSOLE(0)] "Creating Application Cache with manifest http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
09-08 21:22:29.618: I/Ads(2050): JS: Application Cache Checking event (http://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html:0)
09-08 21:22:49.629: W/Ads(2050): Not enough space to show ad. Needs 320x50 dp, but only has 320x0 dp.
게시물 추적을 게시하면 '광고를 표시 할 공간이 충분하지 않습니다'와 같은 메시지가 표시됩니까? – LightYearsBehind
나는 너에게하고 싶다. 아쉽게도 내 logcat이 현재 작동하지 않습니다. 다시 작동하게하려면 Eclipse와 에뮬레이터를 다시 시작합니다. – Pierre
내 logcat을 게시했습니다. 광고 게재를위한 충분한 공간이 없다는 것을 알았습니다. 그러나, 나는 그것을위한 더 많은 공간을 만드는 방법을 알아낼 수 없습니다. – Pierre