綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[教程] 一進去layout,edittext就自動彈出小鍵盤

[複製連結] 查看: 1930|回覆: 0|好評: 0
跳轉到指定樓層
樓主
wind8894 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2012-10-4 23:35

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
本帖最後由 wind8894 於 2012-10-5 00:18 編輯

layout裡面有edittext

為什麼我一進這個layout,就會自動彈出鍵盤,其他layout也有edittext,但是都是被動的,要點擊才會彈出

能夠讓他設成被動嗎?
  1. <LinearLayout
  2.                 android:layout_width="fill_parent"
  3.                 android:layout_height="fill_parent"
  4.                 android:layout_marginBottom="15.0dip"
  5.                 android:orientation="horizontal" >

  6.                 <EditText
  7.                     android:id="@+id/edittext"
  8.                     android:layout_width="fill_parent"
  9.                     android:layout_height="200dp"
  10.                     android:layout_marginLeft="@dimen/register_account_edittext_margin_left"
  11.                     android:layout_marginRight="@dimen/register_account_edittext_margin_left"
  12.                     android:layout_marginTop="10.0dip"
  13.                     android:background="@drawable/global_edittext_bg"
  14.                     android:capitalize="sentences"
  15.                     android:gravity="top|left"
  16.                     android:imeOptions="actionDone"
  17.                     android:inputType="textMultiLine"
  18.                     android:isScrollContainer="true"
  19.                     android:singleLine="false"
  20.                     android:text=""
  21.                     android:textColor="@color/register_account_edittext_color"
  22.                     android:hint="請輸入意見"
  23.                     android:focusable="true" />
  24.             </LinearLayout>
複製代碼
解決了:

方法是在AndroidManifest.xml  加上這兩行
  1. android:windowSoftInputMode="adjustUnspecified|stateHidden"   
  2.             android:configChanges="orientation|keyboardHidden"
複製代碼
  1. <activity android:name="mainactivity" android:windowSoftInputMode="adjustUnspecified|stateHidden"   
  2.             android:configChanges="orientation|keyboardHidden"/>
複製代碼
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏1 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則