【问题标题】:Collapse Toolbar not work correctly when call keyboard from WebView从 WebView 调用键盘时,折叠工具栏无法正常工作
【发布时间】:2015-09-18 00:48:43
【问题描述】:

在我从 WebView 调用键盘之后。有 CoordinatorLayout 空间(我之前尝试过 android:background )。

从 WebView 调用键盘时,折叠工具栏无法正常工作。 但是当我从布局中删除 WebView 时。它工作正常。

   <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>

【问题讨论】:

    标签: android android-layout webview keyboard


    【解决方案1】:

    尝试在您的活动中设置getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)

    【讨论】:

      【解决方案2】:

      此问题仅存在于 Android 支持库旧版本中。 我认为这个问题现在在新版本中得到了解决。

      【讨论】:

        猜你喜欢
        • 2016-12-11
        • 1970-01-01
        • 2018-10-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-01-09
        相关资源
        最近更新 更多