我用微調及以下,我已經使用文本瀏覽和編輯文本,但是當我運行該應用程序的不顯示..我沒有得到爲什麼它不能在模擬器展示。另外我已經在.java中聲明瞭edittext,然後也沒有顯示edittext。我認爲它是微調的bcoz。有人知道爲什麼會發生這種情況?的EditText:EDITTEXT沒有顯示如下微調
這裏是我的全部.XML代碼,
<?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:orientation="vertical"
android:background="@drawable/background">
<TextView
android:id="@+id/textView_navbar_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@drawable/navigation"
android:gravity="center"
android:text="@string/string_subscription"
android:textColor="#ffffff"
android:textSize="20sp" />
<ImageView
android:id="@+id/imageView_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5pt"
android:contentDescription="@string/todo_image"
android:src="@drawable/bg_transparent" />
<TextView
android:id="@+id/textView_startDate_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView_navbar_susa"
android:layout_marginLeft="44dp"
android:layout_marginTop="76dp"
android:text="@string/string_startDate_susa" />
<EditText
android:id="@+id/editText_startDate_susa"
android:layout_width="150sp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView_startDate_susa"
android:layout_alignBottom="@+id/textView_startDate_susa"
android:layout_alignParentRight="true"
android:layout_marginRight="50sp"
android:background="@drawable/subscription_textarea_gray"
android:inputType="date"
android:paddingLeft="10sp"
android:focusable="false" />
<TextView
android:id="@+id/textView_endDate_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView_startDate_susa"
android:layout_below="@+id/editText_startDate_susa"
android:layout_marginTop="38dp"
android:text="@string/string_endDate_susa" />
<EditText
android:id="@+id/editText_endDate_susa"
android:layout_width="150sp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView_endDate_susa"
android:layout_alignBottom="@+id/textView_endDate_susa"
android:layout_alignLeft="@+id/editText_startDate_susa"
android:layout_alignRight="@+id/editText_startDate_susa"
android:background="@drawable/subscription_textarea_gray"
android:inputType="date"
android:paddingLeft="10sp"
android:focusable="false"/>
<TextView
android:id="@+id/textView_type_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView_endDate_susa"
android:layout_below="@+id/editText_endDate_susa"
android:layout_marginTop="38sp"
android:text="@string/string_subscription_type" />
<Spinner
android:id="@+id/spinner_type_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText_endDate_susa"
android:layout_alignRight="@+id/editText_endDate_susa"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/textView_amount_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView_type_susa"
android:layout_below="@+id/spinner_type_susa"
android:layout_marginTop="230sp"
android:text="@string/string_amount_susa" />
<EditText
android:id="@+id/editText_amount_susa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/spinner_type_susa"
android:layout_alignRight="@+id/spinner_type_susa"
android:layout_alignTop="@+id/textView_amount_susa"
android:background="@drawable/subscription_textarea_gray"
android:paddingLeft="10sp"
android:inputType="number" />
</RelativeLayout>
什麼樣的佈局有什麼全部內容你的xml? – 2013-02-19 13:22:46
您使用的RelativeLayout值有問題,我的意思是像'layout_alignTop'將所有這些東西放入'LinearLayout'中,這些東西都會顯示出來。 – 2013-02-19 13:23:16
另一個假設刪除涉及leftOf,rightOf ...等所有屬性 – 2013-02-19 13:24:13