账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    安卓activity webview内嵌h5 h5显示不出来
    61
    0

    webview 内嵌h5 现在h5显示不出来
    h5有内容
    大神们,临时顶安卓项目,死活调试不出来,帮忙看一下万分感谢。

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 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:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".GoodsDetailActivity">
    
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/status_toolbar_total_height"
            android:background="@drawable/shape_gradient"
            app:contentInsetStart="0dp"
            app:elevation="0dp"
            app:layout_collapseMode="pin">
    
            <LinearLayout
                android:id="@+id/ll_back"
                android:layout_width="match_parent"
                android:layout_height="@dimen/toolbar_height"
                android:layout_marginTop="@dimen/toolbar_margin_top"
                android:gravity="center_vertical">
    
                <ImageView
                    android:id="@+id/imageView20"
                    android:layout_width="16dp"
                    android:layout_height="16dp"
                    android:layout_marginLeft="18dp"
                    app:srcCompat="@mipmap/left" />
    
                <TextView
                    android:id="@+id/textView8"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="38dp"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:text="商品详情"
                    android:textColor="@color/background_while"
                    android:textSize="15sp" />
            </LinearLayout>
        </android.support.v7.widget.Toolbar>
    
        <WebView
            android:id="@+id/webView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 碛里沙 普通会员 1楼

      安卓应用中嵌入Webview,Webview不显示可能有以下几个原因:

      1. 网络问题:检查一下网络连接,看看是否可以正常打开网页。

      2. HTML解析问题:检查一下H5代码,看是否正确解析了HTML内容。

      3. WebView权限问题:Android系统在使用WebView时,需要用户的权限。如果用户的权限没有被开启,那么H5页面无法显示。

      4. Android系统问题:Android系统中可能有一些未解决的bug或者设置,导致H5页面无法显示。

      5. WebView版本问题:确保你使用的WebView版本是最新版本。

      针对以上问题,你可以尝试以下方法解决:

      1. 检查网络连接:如果你的网络连接有问题,你可以尝试重启手机或者刷新网络。

      2. 检查HTML解析:检查H5代码是否正确解析了HTML内容。如果代码有误,你需要修改或者重新编写代码。

      3. 询问用户权限:如果你的用户没有开启Webview的权限,你需要询问用户开启权限。

      4. 修复Android系统问题:如果你的Android系统中存在bug或者设置,你可以尝试解决。

      5. 检查WebView版本:确保你使用的WebView版本是最新的。

      希望以上信息对你有所帮助,如果你还有其他问题,欢迎继续提问。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部