0
我正在使用AdWhirl在我的免费应用程序中放置广告。我希望广告出现在MapView下方和ListView上方。无论我尝试什么,我都无法让广告出现在底部以外的任何地方。目前,listView在XML中膨胀,但AdWhirlView必须在Java代码中创建。由于我在垂直方向的LinearLayout上调用addView(adWhirlView),因此广告始终显示在底部。我如何确定广告应放置在哪里?Android布局,如何在调用addView前指定元素的顺序
这里是我的XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layout_main"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1">
<com.google.android.maps.MapView
....
</RelativeLayout>
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1"/>
</LinearLayout>
完美!最后,我失踪了android:layout_height =“wrap_content” –