问题
After I call keyboard from WebView. There is CoordinatorLayout space (I try to android:background before).
The collapse Toolbar not work correctly when call keyboard from WebView. but when I removed WebView from Layout. It work correctly.
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="200dp">
<android.support.design.widget.Collapsing
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
<com.flaviofaria.kenburnsview.KenBurnsView
android:id="@+id/imageCover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/header"
app:layout_collapseMode="parallax" />
<ImageView
android:id="@+id/imageLogo"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_gravity="center_horizontal|center_vertical"
android:src="@drawable/pic_home"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:paddingBottom="12dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@android:color/transparent"
app:tabMode="scrollable"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</android.support.design.widget.Collapsing>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
回答1:
try setting getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
in your Activity
回答2:
This Problem is only in Android Support Library old version. I think this problem is solved now in new version.
来源:https://stackoverflow.com/questions/31151552/collapse-toolbar-not-work-correctly-when-call-keyboard-from-webview