为什么我的WebView填补了我的屏幕的整个宽度是多少? [英] Why isn't my WebView filling up the entire width of my screen?

查看:97
本文介绍了为什么我的WebView填补了我的屏幕的整个宽度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WebView没有填满我的手机的整个宽度。我告诉给FILL_PARENT。不知道为什么?

 < XML版本=1.0编码=UTF-8&GT?;
    < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT
        机器人:方向=横向>

    <的WebView安卓layout_height =FILL_PARENT机器人:layout_width =FILL_PARENT机器人:ID =@ + ID /的WebView>< /的WebView>
    < / LinearLayout中>
 

解决方案

线性布局方向水平,我不认为你可以填写宽度方向上的水平。

尝试使用RelativeLayout的代替。 (刚刚更名的LinearLayout到RelativeLayout的)

My WebView doesn't fill the entire width of my phone. I am telling to fill_parent. Not sure why?

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal">

    <WebView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/WebView"></WebView>
    </LinearLayout>

解决方案

The linear layout is orientation horizontal I don't think you can fill width on orientation horizontal.

Try using RelativeLayout instead. (just rename LinearLayout to RelativeLayout)

这篇关于为什么我的WebView填补了我的屏幕的整个宽度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆