Android開發過程解決軟鍵盤遮住EditText的問題

其實很是簡單,只要有兩處代碼作到了就行了android

一、設置輸入法適應的方式get

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);input

二、設置EditText,加粗的部分就是重點了it

<EditTextio

                            android:id="@+id/login_with_single_password"im

                            android:layout_width="200dp"layout

                            android:layout_height="30dp"margin

                            android:layout_marginLeft="10dp"word

                            android:background="@drawable/edittext_bg"di

                            android:imeOptions="flagNoExtractUi"

                            android:inputType="textPassword"

                            android:padding="5dp"

                            android:password="true"

                            android:singleLine="true"

                            android:textColor="@color/white"

                            android:textSize="12dp"/>

相關文章
相關標籤/搜索