很抱歉,如果这个问题已经被问到,但我找不到任何答案。以下是一些背景信息:
我在 Nexus 4 上测试我的应用程序以修复一些小错误。然而,就在 eclipse 启动它的时候,该区域突然停电,我的电脑也随之关闭。最终,一旦电源恢复,我想我会在再次运行我的应用程序之前通过 .setTypeFace() 设置字体,但这使我的应用程序在我运行时崩溃。因此,在摆弄代码并没有发现任何修复之后,我决定摆脱整个字体,只运行带有错误修复的应用程序。但是,这使我的应用看起来像 this .
现在在 Eclipse 上,图形布局显示 this .今天之前我的应用程序显示的图形布局非常好。 eclipse 上没有出现任何错误。
为什么会发生这种情况,我该如何解决?我可以破坏整个文件吗? 谢谢。
编辑: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>
最佳答案
我终于想通了 - 这是背景。我一定是在某个地方弄乱了 9.png,因为一旦我摆脱了背景,它就会自行修复。
关于android - xml/linearlayout 无法在设备上正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14530498/