2015-09-14 71 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

回答