我为我的应用程序做了一个背景,但现在它不会运行

时间:2012-10-06 21:16:00

标签: android xml android-layout background

我刚为我正在制作的这款应用设置了背景,但现在它无法运行。在我分配背景之前它正在工作。我想知道是否有人可以帮助我。也许我应该有一些Java代码呢?

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/backgroundhdpi" >

        <EditText
            android:id="@+id/bill"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="100dp"
            android:ems="10"
            android:inputType="phone"
            android:text="Enter Your Bill"
            android:textSize="18dip" />

        <Button
            android:id="@+id/calculateTip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/bill"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="40dp"
            android:layout_marginLeft="15dp"
            android:text="Calculate" />

        <TextView
            android:id="@+id/tipOwed"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/bill"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="123dp"
            android:scrollHorizontally="false"
            android:text="Time to Tip"
            android:textColor="#2c6f37"
            android:textSize="35dip"
            android:textStyle="bold" />

    </RelativeLayout>

1 个答案:

答案 0 :(得分:0)

只要背景处于res / drawable中,它就不会导致任何崩溃问题。没有Java需要与以这种方式设置背景相关联。 logcat中是否有错误?

(我会留下这个评论,但我没有足够的代表这样做)

相关问题