Android解决输入法阻挡

 Activity :

<activity android:name="testActivity"   android:windowSoftInputMode="adjustPan">  

<ScrollView xmlns:Android="http://schemas.android.com/apk/res/android "
        Android:layout_width="fill_parent"
        Android:layout_height="fill_parent">
    <LinearLayout Android:orientation="vertical"
            Android:layout_width="fill_parent"
            Android:layout_height="fill_parent">
        <EditText Android:id="@+id/content"   
                Android:layout_width="fill_parent"   
                Android:layout_height="wrap_content"   
              Android:lines="4"
              Android:scrollbars="vertical"
                Android:gravity="fill_horizontal" />
    </LinearLayout>
</ScrollView> 

Dialog:

onCreate方法中添加
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE |
                WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 

猜你喜欢

转载自blog.csdn.net/shenxingshu/article/details/89337558