簡體   English   中英

顯示鍵盤時EditText未完全顯示

[英]EditText not showing fully when keyboard is showing

我有一個具有自定義背景的編輯文本。 當他們的鍵盤打開時-屏幕會調整以顯示焦點的edittext,問題是,它會剪切我的自定義背景。

打開鍵盤時,顯示我的編輯文本(包括筆觸的白色背景)的最佳方法是什么?

我現在的清單是在adjustPan設置上。

附加圖片:

全屏,鍵盤關閉: 鍵盤關閉的屏幕

打開鍵盤全屏顯示(不顯示所有密碼edittext) 打開鍵盤的屏幕

將此添加到清單部分。

 <activity 
        android:windowSoftInputMode="stateHidden|adjustPan|adjustNothing"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"

          />

活動的主窗口未調整大小以為軟鍵盤騰出空間。 而是,窗口的內容會自動平移,以使當前焦點不會被鍵盤遮擋,並且用戶始終可以看到他們正在鍵入的內容。 通常,這不如調整大小那么可取,因為用戶可能需要關閉軟鍵盤才能到達窗口的模糊部分並與之交互。

試試這個讓你這樣的布局

 <ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

 <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical">
  // add here all your controls
</LinearLayout>

</ScrollView>

並在清單文件中添加您的活動

        <activity
        android:name=".SignupActivity"
        android:parentActivityName=".MainActivity"
        android:windowSoftInputMode="stateHidden|adjustResize"
        android:configChanges="keyboardHidden|orientation|screenSize"/>

嘗試這個:

<activity 
   android:name=".activityname"
   android:windowSoftInputMode="adjustPan|adjustResize" ></activity>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM