【发布时间】:2020-03-24 11:12:24
【问题描述】:
我想将底部导航和广告固定到底部。但画面仍如所见。你能帮助我吗? 我的xml代码如下
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:gravity="bottom"
android:layout_gravity="bottom"
android:layout_height="match_parent"
android:layout_below="@+id/bottom_nav"
android:background="@drawable/bgapp"
android:orientation="vertical"
tools:context=".Anasayfa"
tools:ignore="NotSibling">
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-7657308039754206/7261639976"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:itemBackground="@drawable/altbottom"
app:itemIconSize="25dp"
app:itemIconTint="@drawable/itemcolors"
app:labelVisibilityMode="auto"
app:menu="@menu/bottom_nav_menu"
tools:ignore="MissingConstraints"/>
</LinearLayout>
【问题讨论】:
-
我们需要您的布局文件才能提供帮助。
-
我为你编辑了它
-
这是完整的布局文件吗?我找不到bottom_nav
标签: android android-layout android-linearlayout