2011-08-03 61 views
3

在下面的屏幕截圖中,我有一個圖像是後跟通過滾動視圖。滾動視圖包含tablelayout,然後一些的EditText領域,其次是按鍵如何禁用android模擬器鍵盤彈出

enter image description here

當我想值進入我的領域,鍵盤彈出,它擋住了我的領域來看,像這樣:

enter image description here

正如你所看到的,它會阻止我的EditText上田的觀點。是否有隱藏鍵盤的優雅修復程序?如果沒有,我會改變我的佈局,但我不知道要改變什麼。我的佈局是這樣的:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#CCCCCC" 
    android:weightSum="1" android:id="@+id/llid"> 
    <TextView ... > 
    </TextView> 
    <!-- Image inserted here as an ImageView from my code --> 
    <ScrollView 
     android:id="@+id/svid" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_marginTop="3dp"> 
     <LinearLayout> 
      <TableLayout ... > 
       <TableRow> 
        <TextView ... /> 
        <TextView ... />    
       </TableRow> 
       <TableRow> 
        <TextView ... /> 
        <TextView ... />    
       </TableRow> 
       <TableRow> 
        <TextView ... /> 
        <TextView ... />    
       </TableRow>       
      </TableLayout> 
      <EditText> 
      ... 
      </EditText> 
      <EditText> 
      ... 
      </EditText> 
      <EditText> 
      ... 
      </EditText> 
      <Button> 
      ... 
      </Button>           
     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

回答

4

我首先想到的就是去到仿真器中的設置:

設置 - >語言和鍵盤 ,取消選擇「Android鍵盤」及其他奇怪的,如果他們被選中太

+1

關閉該鍵盤剛纔檢查這一點,它的工作原理 –

+0

我未選中的每一個選項。 –

+0

什麼是對的路徑?我進入了「菜單 - >設置 - >語言和鍵盤」。我沒有選中「Android鍵盤」。我也沒有選中'菜單 - >設置 - >語言和鍵盤 - > Android鍵盤設置'下的每一個選項,但沒有喜悅 – Joeblackdev

2

由於模擬器是假設模仿什麼將是非常有意義的,如果你正在嘗試值輸入到文本字段中的鍵盤就會彈出手機上看到。我的理解可能是刺激性,但你不應該在你的代碼可以禁用它,因爲這將禁用它在手機上,然後用戶將如何進入他們的投入?

此外,您還可以按硬件後退按鈕時,彈出來取消鍵盤。

+0

嗯,這個應用程序是隻是一個原型,因此我使用模擬器。我不會在手機上運行它。這只是一個測試應用程序,所以我不關心在手機上運行它。 – Joeblackdev

0

編程可以設置鍵盤禁止通過

public void removeKeyboard(EditText e, Context context){ 
    InputMethodManager keyB = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); 
    keyB.hideSoftInputFromWindow(e.getWindowToken(), 0); 
} 

其中的EditText E或打電話進行文字輸入

更新一些其他的看法! 如果將用戶輸入與搜索查看我已經發現了一些短的路僅通過

nameButton.clearFocus();