在 Eclipse 中的图形布局中,EditView、TextView 和按钮是我希望它们出现的位置。但是当我在手机上运行它们时,它们会被移动到不同的位置。有人可以帮我把它们放在我想让它们放在哪里吗?
这是我的代码:
<?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>