java我无法正确呈现editText
我无法正确地渲染EditText,因为它超出了屏幕 但在eclipse的图形布局选项卡中,它正确地显示出来了。 请帮助我,我是安卓新手。我已经为第一行编写了示例代码
<RelativeLayout xmlns:安卓="http://*****.*****.***/apk/res/安卓"
安卓:layout_width="wrap_content"
安卓:layout_height="fill_parent"
安卓:background="#FFFFFF" >
<TableLayout
安卓:layout_width="wrap_content"
安卓:layout_height="wrap_content"
安卓:layout_centerHorizontal="true"
安卓:layout_marginTop="30dp">
<TableRow>
<TextView
安卓:id="@+id/textView1"
安卓:layout_width="fill_parent"
安卓:layout_height="wrap_content"
安卓:layout_above="@+id/editText2"
安卓:layout_alignParentLeft="true"
安卓:layout_marginBottom="29dp"
安卓:layout_marginLeft="0dp"
安卓:text="Counter Id"
安卓:textAppearance="?安卓:attr/textAppearanceMedium"
安卓:textColor="#000000" />
<EditText
安卓:id="@+id/editText1"
安卓:layout_width="fill_parent"
安卓:layout_height="wrap_content"
安卓:layout_alignBaseline="@+id/textView1"
安卓:layout_alignBottom="@+id/textView1"
安卓:layout_marginLeft="0dp"
安卓:layout_toRightOf="@+id/textView1"
安卓:ems="10" />
</TableRow>
</TableLayout>
# 1 楼答案
使用加权和的线性布局。 http://developer.android.com/reference/android/widget/LinearLayout.html
或者 针对不同的屏幕大小使用不同的布局。 例如:LDPI、MDPI、HDPI、XHDPI、XXHDPI等