Android:adview上方的布局_在列表视图上不起作用
我正在尝试使用android:layout_over=“@+id/adView”在列表视图下方显示横幅广告,但不起作用。横幅广告后仍显示列表视图。如何解决此问题?如何将列表视图置于横幅广告上方或横幅广告置于列表视图下方Android:adview上方的布局_在列表视图上不起作用,android,android-layout,admob,Android,Android Layout,Admob,我正在尝试使用android:layout_over=“@+id/adView”在列表视图下方显示横幅广告,但不起作用。横幅广告后仍显示列表视图。如何解决此问题?如何将列表视图置于横幅广告上方或横幅广告置于列表视图下方 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:ads=
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-xx/xx">
</com.google.android.gms.ads.AdView>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeToRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:layout_margin="@dimen/fab_margin">
<ListView
android:id="@+id/listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/adView"
/>
</android.support.v4.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/emptyList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Text"
android:textColor="#212121"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="Test 2"
android:textColor="#212121" />
</LinearLayout>
列表视图位于SwipeRefreshLayout
android:layout_above="@+id/adView"
因此,将这行代码添加到swiperfreshlayout
android:layout_above="@+id/adView"
listView位于SwipeRefreshLayout
android:layout_above="@+id/adView"
因此,将这行代码添加到swiperfreshlayout
android:layout_above="@+id/adView"
listview的下边距可能有效listview的下边距可能有效。多谢各位@完美的。多谢各位@阿尼尔