xml / linearlayout在设备上无法正常显示

时间:2013-01-25 21:14:29

标签: android xml eclipse

如果已经问过这个问题,我很抱歉,但我找不到任何答案。这是一些背景背景:

我在Nexus 4上测试我的应用程序来修复一些小错误。然而,就像eclipse正在启动它一样,该区域有一个电源切断,关闭我的电脑。最终,一旦电源恢复,我想我会在再次运行我的应用程序之前通过.setTypeFace()设置一个字体但是当我运行它时这会让我的应用程序崩溃。因此,在摆弄代码并找不到修复后,我决定摆脱整个字体,只需运行应用程序修复bug。但是,这使我的应用看起来像this

现在在eclipse上,图形布局显示this。我今天之前的应用程序显示出的图形布局非常好。日食没有出现任何错误。

为什么会发生这种情况,我该如何解决这个问题?我可以破坏整个文件吗? 感谢。

编辑:xml文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/testbg"
    android:orientation="vertical"
    android:weightSum="100" >

    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="33" >

    ---- bunch of textviews ----

    </RelativeLayout>

    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="57" >

    ---- More Textviews ----

    </RelativeLayout>

    <LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="10"
    android:orientation="horizontal"
    android:weightSum="3" >

    ---- three buttons ----

</LinearLayout>

</LinearLayout>

2 个答案:

答案 0 :(得分:1)

我终于明白了 - 这是背景。我一定显然搞砸了某个地方的9.png,因为一旦我摆脱了背景,它就会自我修复。

答案 1 :(得分:0)

正常情况下,当我更改字体时,我的应用程序会发生这种情况,某些字体在布局中显示如此,我使用的一些游戏是在标签空间后添加字符或点,并且它可以工作,但请仔细检查字体问题再次尝试再次设置字体或设置另一种字体。