我正在为我的应用程序实现Flurry横幅广告。但是它会占据全屏。我的主要activity.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/bannerframe" >
</FrameLayout>
<SeekBar
android:id="@+id/volumeBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
在Java中,我正在编写以下代码。
FrameLayout fViewGroup = (FrameLayout)findViewById(R.id.bannerframe);
FlurryAgent.onStartSession(appContext, "My API Key is here");
FlurryAgent.initializeAds(appContext);
FlurryAgent.getAd(appContext, "Deer Hunting Calls",fViewGroup,FlurryAdSize.BANNER_TOP, 0);
以下是我收到的屏幕截图。 有人知道为什么add占据了整个屏幕吗? 我已经尝试了android:layout_width和height的所有选项,包括fill_parent、warp_content、match_parent等,但仍然得到相同的结果。