【发布时间】:2017-01-16 04:03:13
【问题描述】:
我想让我的 webview 适合屏幕,现在沿 webview 有一个小的空白边框(不是全屏显示)。如何使用 xml 代码
使我的 webview 适合屏幕 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.fb.jaisonjoseph.facebookbasic.Home_Fragment">
<!-- TODO: Update blank fragment layout -->
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/webView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true" />
</RelativeLayout>
【问题讨论】:
-
我认为你已经使用了片段。因此,请尝试检查活动 xml 中的填充或边距。
-
尝试使用 webview 的 layout_weight & height match_parent ...也将你的 main_activity .XML 文件放入
-
我也试过@SagarAghara
-
是的...然后在您的 activity_main 中删除边距或填充,这将解决您的问题..@DheerubhaiBansal 已经告知
-
是的 100% 在你的 activity_main 16dp 中填充,检查一下。