Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WebvView缩放在android.support.v4.widget.NestedScrollView android中不起作用_Android_Webview_Zooming - Fatal编程技术网

WebvView缩放在android.support.v4.widget.NestedScrollView android中不起作用

WebvView缩放在android.support.v4.widget.NestedScrollView android中不起作用,android,webview,zooming,Android,Webview,Zooming,我已经在Android中创建了浏览器,因为我使用AppBarLayout和NestedScrollView来滚动隐藏/显示标题。但在NestedScrollView中添加webview后,会出现一个问题,即禁用缩放 我的xml代码是: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.andro

我已经在Android中创建了浏览器,因为我使用AppBarLayoutNestedScrollView来滚动隐藏/显示标题。但在NestedScrollView中添加webview后,会出现一个问题,即禁用缩放

我的xml代码是:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true" >

    <android.support.design.widget.CustomAppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true" >

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_collapseMode="pin"
            app:layout_scrollFlags="scroll|enterAlways"
            app:contentInsetLeft="0dp"
            app:contentInsetStart="0dp" >

            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:background="@android:color/black"
                android:orientation="vertical"
                android:paddingTop="@dimen/statusbar_height" >

                <LinearLayout
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center" >

                        <ImageView
                            android:id="@+id/favicon"
                            android:layout_width="32dp"
                            android:layout_height="32dp"
                            android:contentDescription="@string/favicon"
                            android:src="@drawable/favicon_default" />

                        <EditText
                            android:id="@+id/url"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:ems="10"
                            android:inputType="textUri"
                            android:selectAllOnFocus="true"
                            android:textColor="@android:color/white" >
                        </EditText>

                        <Button
                            android:id="@+id/goButton"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:onClick="go"
                            android:text="@string/go" />
                    </LinearLayout>                     
                </LinearLayout>
            </LinearLayout>
        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.CustomAppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:id="@+id/scrollWeb"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        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>

谢谢。

这是customWebView,请尝试仅使用WebView@DemoMail,我尝试使用WebView,同样的结果你找到解决方案了吗?你能在你的应用程序上发送链接吗?我的应用程序现在处于开发模式
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);