【发布时间】:2015-08-26 10:19:50
【问题描述】:
我在我的安卓应用中添加了Toolbar、Tablayout 和Viewpager。 TabLayout中有三个Tabs,每个都显示一个WebView。
当用户在WebView 中向下/向上滚动时,我将WebView 放在NestedScrollView 中以隐藏/显示Toolbar。 Toolbar 隐藏在 Android 3.0 或更高版本中。
但不幸的是,在 Android 2.3 或更低版本中,WebView 起初不会滚动。我必须滑动到另一个选项卡,当我再次回到第一个 Tab 时,WebView 开始滚动。
我想要什么?
我希望WebView 滚动到Android 2.3 或更少,没有任何问题。
我的网络视图
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:isScrollContainer="false"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="1dp">
<WebView
android:id="@+id/webviewtool"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:numColumns="1"
android:scrollbars="none"
android:focusableInTouchMode="false"
android:focusable="false"
android:background="#FFFFFF" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
【问题讨论】:
标签: android webview android-viewpager toolbar nestedscrollview