输入框单独被软键盘弹起的解决方案

1、重新开一个Activity

重新开一个透明的activity
<style name="TransparentTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@color/com_transparent</item> <item name="android:windowAnimationStyle">@style/AnimationShareActivity</item> <item name="android:windowIsTranslucent">true</item> </style>

<activity
  android:name="com.joyodream.pingo.topic.post.ui.JigsawInputEditActivity"
  android:label="@string/app_name"
  android:theme="@style/TransparentTheme"
  android:screenOrientation="portrait"
  android:windowSoftInputMode="stateAlwaysVisible|adjustResize"
  >
</activity>

2、使用全屏的Dialog

使用透明、全屏、无标题的Dialog,自定义的View
<style name="input_dialog" parent="@android:style/Theme.Dialog"> <!-- 边框 --> <item name="android:windowFrame">@null</item> <!-- 半透明 --> <item name="android:windowIsTranslucent">false</item> <!-- 无标题 --> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@android:color/transparent</item> <!-- 模糊 --> <item name="android:backgroundDimEnabled">true</item> <!-- 占全屏 --> <item name="android:windowFullscreen">true</item> </style>

另外可以使用paddingBottom 和背景分离的方案,让 输入框完美弹起
原文地址:https://www.cnblogs.com/lipeil/p/5026204.html