2013-04-10 136 views
0

裏面我有這樣的佈局的EditText滾動型顯示鍵盤

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/LinearLayout1" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
tools:context=".MainActivity" > 



<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" > 

     <EditText 
      android:id="@+id/editText1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:ems="10" > 

     </EditText> 

     <EditText 
      android:id="@+id/editText2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:ems="10" /> 

     <Button 
      android:id="@+id/button1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="Button" /> 

    </LinearLayout> 
</ScrollView> 

</LinearLayout> 

..和當我執行我的應用程序,顯示鍵盤。

http://img62.imageshack.us/img62/2879/screenshot2013041012264.png

如果我不使用滾動視圖,這不會發生,除非我點擊一個EditText上。

我想不顯示鍵盤(有滾動視圖),當我執行我的應用程序,除非我點擊edittext。

有什麼想法嗎?

的感謝!

回答

0

你可以把機器人:windowSoftInputMode = 「stateHidden」在活動代碼清單文件的

+0

謝謝!它工作正常!!!!! – Bae 2013-04-10 15:15:02