Java 带折叠工具栏布局的XML android webview
有没有一种方法可以像chrome浏览器那样使用折叠的搜索栏来创建网络视图?我尝试过使用坐标布局,并在webview周围有一个嵌套的ScrollView,但问题是高度会变得无限大,而且应该没有办法修复它。我做了很多关于如何做到这一点的研究,但我能找到的只是使用nestedscrollview。有没有人知道如何修复这个bug,或者有没有关于如何使用一个折叠的搜索栏/工具栏创建webview的示例Java 带折叠工具栏布局的XML android webview,java,android,xml,android-webview,android-collapsingtoolbarlayout,Java,Android,Xml,Android Webview,Android Collapsingtoolbarlayout,有没有一种方法可以像chrome浏览器那样使用折叠的搜索栏来创建网络视图?我尝试过使用坐标布局,并在webview周围有一个嵌套的ScrollView,但问题是高度会变得无限大,而且应该没有办法修复它。我做了很多关于如何做到这一点的研究,但我能找到的只是使用nestedscrollview。有没有人知道如何修复这个bug,或者有没有关于如何使用一个折叠的搜索栏/工具栏创建webview的示例 <android.support.v4.widget.DrawerLayout xmlns
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_design_support_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:expandedTitleMarginStart="60dp">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="255dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</android.support.design.widget.CollapsingToolbarLayout>
</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:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/webView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
这就是你要找的东西,只是在帖子中添加了一张图片@FirozMemo这个github项目可能会对你有所帮助:这看起来正是我想要的,但是你知道为什么状态栏会在gif中显示它后面的文本吗?我对此一无所知,伙计,你可能需要咨询项目的所有者。