如何设置android底部导航栏位置固定在android
问题描述:
请帮我设置底部导航栏位置固定在底部, ,因为我在输入editText字段时遇到问题,底部导航栏向上移动并覆盖其他领域如何设置android底部导航栏位置固定在android
代码:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--- -->
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:background="#FF6936C3"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="start"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"
app:menu="@menu/bottom_nav_items" />
</RelativeLayout>
答
<LinearLayout>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?android:attr/windowBackground"
app:menu="@menu/navigation" />
</LinearLayout>
您可以定义线性布局,并将其底部导航放置在其中,并将其重力设置为底部。 您可以找到其他细节:https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.html
答
尝试,包括该代码在你的清单
<activity android:name=".YourActivity"
android:windowSoftInputMode="adjustNothing">
+0
非常感谢公司对我的工作 –
答
android:layout_gravity="start"
改变它如下:
android:layout_gravity="bottom"
它不是由这个解决那么问题出在其他代码。目前还不清楚你是否已经告诉了编辑文本,但是它的位置有些不匹配。
希望,你明白
https://blog.stylingandroid.com/bottomnavigationview/ – gaurang