2017-03-24 32 views
2

我有一個EditTextdrawable背景(A矩形形狀的角和顏色,沒有什麼花哨)enter image description here鍵盤重疊自定義編輯文本

案例1EditText變得專注於點擊,查看班次以上但軟鍵盤仍然部分重疊,以便提示可以正確顯示,但背景被裁剪。

案例2(內部片段,怎麼把這個問題並沒有在活動發生),如果我從一個編輯文本的目標EditText上述背景再次修剪旁邊按與鍵盤剛剛接觸的底部暗示。

我附上它ScrollView內,試圖android:windowSoftInputMode="stateAlwaysHidden|adjustResize"(用不同的組合也是如此),但似乎沒有任何工作

有沒有辦法通過override軟鍵盤打開時按下視圖的y軸?

+0

我面臨同樣的問題。你有沒有找到解決辦法? –

回答

0

工作的一半是由Scrollview本身完成,

試着在你寫這些線edittext

editText.requestLayout(); 
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED); 

onFocusChanged方法和你的.xml會是什麼樣子 -

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

     <ScrollView 
     android:layout_height="match_parent" 
     android:layout_width="match_parent" 
     android:weightSum="1"> 

     .... your editetexts here... 

     </ScrollView> 
</LinearLayout> 
+0

不,它沒有工作:/ –