2013-03-25 56 views
0

我有一個文本編輯的問題。我禁止鍵盤彈出活動開始,但是如何讓光標停留在第一個編輯文本上?我希望光標僅在editText字段被點擊時以及活動開始時出現。如何保持光標不移到editText字段上的活動開始android

<EditText 
      android:id="@+id/stuff" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/stufflabel" 
      android:layout_toRightOf="@+id/stuffpic" 
      android:hint="@string/name_str" 
      android:maxLength="20" 
      /> 
+0

搜索功能會幫助你。請參閱http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup – Bloodkite 2013-03-25 20:51:18

+0

創建一個虛擬元素並在啓動時爲其設置焦點。 http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup – hiphopsmurf 2013-03-25 20:51:43

+0

哦對不起,我還是這個論壇的新手。謝謝!! – user2206030 2013-03-25 20:56:37

回答

0

您可以在XML文件的內部佈局添加一個虛擬的EditText,使重點將獲得對EditText上,而不是其他的EditText。

<EditText 
    android:layout_width="0dp" 
    android:layout_height="0dp" /> 
相關問題