Android 人行横道';s XWalkView(Webview的替代品)不使用AppBarLayout+;协调布局
我试图使用Android 人行横道';s XWalkView(Webview的替代品)不使用AppBarLayout+;协调布局,android,webview,android-scrollview,crosswalk-runtime,android-coordinatorlayout,Android,Webview,Android Scrollview,Crosswalk Runtime,Android Coordinatorlayout,我试图使用CoordinatorLayout和AppBarLayout实现滚动Toolbar技术(在同级子视图中向下滚动时隐藏Toolbar) 我使用的是(它是一个功能类似WebView的视图) 使用常规(在嵌套滚动视图中)时,我可以达到想要的效果: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns
CoordinatorLayout
和AppBarLayout
实现滚动Toolbar
技术(在同级子视图中向下滚动时隐藏Toolbar
)
我使用的是(它是一个功能类似WebView的视图)
使用常规(在嵌套滚动视图
中)时,我可以达到想要的效果:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/webViewOrig"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
视图甚至没有出现
当删除以下行时
app:layout_behavior="@string/appbar_scrolling_view_behavior"
XWalkView
至少显示在整个屏幕和工具栏顶部
我该怎么做才能让它工作?因为它是开源的,我应该能够让它工作。。。我怀疑它要么是子类XWalkView
并实现一些接口(NestedScrollingChild
?),要么是通过子类化CoordinatorLayout.Behavior
或AppBarLayout.ScrollingViewBehavior
来创建自定义行为
有什么想法吗
顺便说一句,XWalkView正在内部使用or来呈现web内容。我也有同样的问题,你已经解决了吗?@LucaLooz你找到解决方案了吗?
app:layout_behavior="@string/appbar_scrolling_view_behavior"