首页 > 其他 > 详细

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

时间:2015-12-07 16:08:17      阅读:164      评论:0      收藏:0      [点我收藏+]

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 和背景分离的方案,让 输入框完美弹起

 

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

原文:http://www.cnblogs.com/lipeil/p/5026204.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!