【发布时间】:2023-04-10 12:41:01
【问题描述】:
所以我创建了一些 html 页面以通过 WebView 嵌入到应用程序中,这些页面本身在普通的 android 浏览器中工作正常但是在 WebView 模块中页面的宽度只有 313,它允许有点水平滚动,这在 Android 的普通浏览器中不会发生。
所以所需的宽度是320px,WebView 正在输出313px,但仍然允许水平滚动(几个像素)。
以下是我的布局代码,我假设 Android 正在将一些我不知道的内联样式注入到 webview 中,想知道是否有人遇到同样的问题?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/help_webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>
【问题讨论】:
-
你可能想看看这里:stackoverflow.com/questions/4970045/… 这对我有用。
标签: android android-layout webview