如何使一个全屏的WebView [英] How to make a full screen webview
问题描述
如何使Android应用程序全屏的web视图。我已经加入上的布局xml文件web视图,但它不伸出直到布局的边缘,有一些类型的余量沿web视图的所有的边。我还增加了一个形象,给你们什么实际它看起来像一个提示。
我说的是空间周围所有的web视图,没有通知栏或标题栏
这里的布局code:
< RelativeLayout的的xmlns:机器人=http://schemas.android.com/apk/res/android
的xmlns:工具=http://schemas.android.com/tools
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:paddingBottom会=@扪/ activity_vertical_margin
机器人:以下属性来=@扪/ activity_horizontal_margin
机器人:paddingRight =@扪/ activity_horizontal_margin
机器人:paddingTop =@扪/ activity_vertical_margin
工具:的WebView上下文=>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_centerHorizontal =真
机器人:layout_centerVertical =真
机器人:文本=摇/倾斜你的手机来获取加速度运动警报/>
<的WebView
机器人:ID =@ + ID / web视图
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:layout_alignParentLeft =真
机器人:layout_alignParentTop =真/>
< / RelativeLayout的>
从以上code删除填充标记
-
的android:paddingBottom会=@扪/ activity_vertical_margin
机器人:以下属性来=@扪/ activity_horizontal_margin
机器人:paddingRight =@扪/ activity_horizontal_margin
机器人:paddingTop =@扪/ activity_vertical_margin
这将做的工作,也一定要删除HTML的利润率/填充你所渲染到可能含有留下一定的空间,这些标签的web视图。
How to make the webview of an android application full screen. I have added the webview on a layout xml file but it doesn't stretches out till the edges of the layout, there is some type of margin along all the side of the webview. I am also adding an image to give you guys a hint on what actually it is looking like.
What i am talking about is the space all around the webview, not the notification bar or the title bar
Here's the layout code:
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".WebView" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Shake / Tilt Your Phone To Get Accelerometer Motion Alerts" />
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
From above code remove padding tags
-
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
It will do the job and also be sure to remove the HTML's margins/padding which you are rendering into the WebView that might contain those tags which leaves some space.
这篇关于如何使一个全屏的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!