2015-09-14 125 views
1

我无法正确呈现EditText,但它在屏幕外 之外,但在eclipse中的Graphical Layout选项卡中正确显示。 请帮助我是新来的android。我写的示例代码第1行我无法正确呈现editText

Runtime image, this what I am getting when I run the android application

<RelativeLayout xmlns:android="http://*****.*****.***/apk/res/android" 
android:layout_width="wrap_content" 
android:layout_height="fill_parent" 
android:background="#FFFFFF" > 

<TableLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="30dp"> 

    <TableRow> 
     <TextView 
    android:id="@+id/textView1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/editText2" 
    android:layout_alignParentLeft="true" 
    android:layout_marginBottom="29dp" 
    android:layout_marginLeft="0dp" 
    android:text="Counter Id" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:textColor="#000000" /> 

     <EditText 
    android:id="@+id/editText1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignBaseline="@+id/textView1" 
    android:layout_alignBottom="@+id/textView1" 
    android:layout_marginLeft="0dp" 
    android:layout_toRightOf="@+id/textView1" 
    android:ems="10" /> 

    </TableRow> 
    </TableLayout> 
+0

如果这是您计划创建的布局,只需使用RelativeLayout即可。 TableLayout在绘图时会产生很多问题。 –

+1

在你的tablelayout尝试把这个看到... android:layout_width =“match_parent”android:stretchColumns =“1”android:shrinkColumns =“1” – Nic

+0

给你的父亲布局'RelativLayout'一些右边缘 – Rustam

回答