嗨我有點困惑於BottomNavigationView
職位行爲。爲什麼BottomNavigationView的位置取決於ScrollView滾動條?
爲什麼啓用/禁用滾動條影響調整大小的佈局和位置BottomNavigationView
?
我創建簡單的示例項目,以顯示我的問題......
有了這個代碼:
<?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:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="sandbox.jarda.cz.bottomnavigationtest.MainActivity">
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="test" />
</LinearLayout>
</ScrollView>
</FrameLayout>
<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>
請問BottomNavigationView
住宿鍵盤下(打開時)...
但是:)
當我刪除線/支持滾動條
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
主要佈局 「調整大小」 和BottomNavigationView
是在鍵盤的頂部...
WHY ?
THX的答案:)
是的,這是工作=> BottomNavigationView是下鍵盤......但我的問題是,爲什麼滾動條影響該定位? :) – Jarda
@Jarda **「adjustResize」**非常重要,如果您的UI包含用戶在執行文本輸入之後或之後可能需要立即訪問的控件。 **例如**,如果您使用相對佈局在屏幕底部放置按鈕欄,則使用「adjustResize」調整佈局大小,以使按鈕欄顯示在輸入法上方。 –
我認爲不是因爲scrollbars @ Jarda –