今天遇到一个问题,就是软件盘弹出来以后,会把之前的布局界面整个的挤到屏幕的外面,而且按下返回建以后,这个软件盘占据的空间会留下一个黑色的背景。在网上查找了很多的方法,刚开始都是说,如下方法

 <activity

        android:label="@string/app_name"
android:theme="@style/ComposeTheme"
android:name="com.android.email.activity.ComposeActivityEmail"
android:windowSoftInputMode="adjustPan" 
       android:configChanges="keyboard|keyboardHidden|fontScale|orientation|screenSize">
android:windowSoftInputMode="adjustPan"这个属性就是设置软件盘的,他的值有9个,具体怎么使用,以后用到了再说,不过,它并没有解决我的问题

后来同事给我说了个方法,成功解决。就是在弹出软件盘所在的activity中,加入一个代码就行了
import android.view.WindowManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.email_vip_activity);
/* Vanzo:zhangshuli on: Thu, 15 Jan 2015 21:26:00 +0000
*/
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE_FULLSCREEN);//这一句是关键
// End of Vanzo: zhangshuli Intent i = getIntent();
mAccountId = i.getLongExtra(ACCOUNT_ID, -1);
if (savedInstanceState == null && mAccountId != -1) {
// First-time init; create fragment to embed in activity.
FragmentTransaction ft = getFragmentManager().beginTransaction();
Fragment newFragment = VipListFragment.newInstance(mAccountId);
ft.add(R.id.fragment_placeholder, newFragment);
ft.commit();
}
mActionBar = getActionBar();
// Configure action bar.
mActionBar.setDisplayOptions(
ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
mActionBar.setDisplayShowCustomEnabled(true);
mActionBar.setDisplayShowTitleEnabled(false);
// Prepare the custom view
mActionBar.setCustomView(R.layout.vip_actionbar_custom_view);
mActionBarCustomView = (ViewGroup) mActionBar.getCustomView();
mVipMembers = (TextView)mActionBarCustomView.findViewById(R.id.vip_member);
/**
* M: When all accounts has been deleted, the vip list activity will be
* finished and login page will be displayed. @{
*/
if (mAccountObserver == null) {
mAccountObserver = new AccountContentObserver(null, this);
}
getContentResolver().registerContentObserver(Account.NOTIFIER_URI, true, mAccountObserver);
/** @} */
}
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE_FULLSCREEN);//这一句是关键

完美解决了问题。至于为什么加载AndoridManifest.xml中没有作用,现在还不知道

softInputMode- 软件盘的设置的更多相关文章

  1. Android 软件盘 动态设置 layout

    总体来说分为三种方法: 在编辑框输入内容时会弹出软键盘,而手机屏幕区域有限往往会遮住输入界面,我们先看一下问题效果图: 输入用户名和密码时,系统会弹出键盘,造成系统键盘会挡住文本框的问题,如图所示: ...

  2. Angular input / ion-input ion-searchbar 实现软件盘换行 改 搜索 并且触发搜索方法 Android iOS适用

    Angular 实现软件盘 换行 改 搜索 并且除非 搜索方法:    Form 必须有 action="javascript: return true;”   input / ion-in ...

  3. 几种常见的FTP软件的二进制设置说明

    几种常见的FTP软件的二进制设置说明: 1.FlashFXP: 打开 FlashFXP:在工具栏中,选项 => 参数(也可以直接按F6键),在弹出来的窗口中,选择“传输(T)”卡,在传输模式中选 ...

  4. Android软件盘InputMethodManager

    调用下面代码:(第一次调用显示,再次调用则隐藏,如此反复),this指activity InputMethodManager imm = (InputMethodManager)this.getSys ...

  5. Win10如何禁止软件运行?win10禁止软件启动的设置方法!禁止人生日历热点快讯的方法

    相信不少使用Win10系统的用户遇到过下载了一款软件进行安装后后续会有接连不断的程序安装到电脑中.他可能似乎一个大家常用的程序,在我们安装好运行的时候会通过后台偷偷下载其他应用安装到我们电脑中,导致系 ...

  6. Linux串口设备树硬件、软件流控设置

    /********************************************************************** * Linux串口设备树硬件.软件流控设置 * 说明: ...

  7. ios 底部用定位 fixed。在软件盘出来后,页面元素被顶上去一部分,fixed定位的footer也跑到了上面去。解决方法

    ios 底部用定位 fixed.在软件盘出来后,页面元素被顶上去一部分,fixed定位的footer也跑到了上面去.解决方法 $("input").focus(function() ...

  8. PopuWindow和软件盘共存时的设置

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/mingyue_1128/article/details/32316069 一.键盘不消失,popuw ...

  9. Android 软件盘 Editext 问题

    显示的问题:android:windowSoftInputMode="adjustPan|stateHidden" 弹出布局Editext并且挤上去 android:windowS ...

随机推荐

  1. CF 420B Online Meeting 模拟题

    只是贴代码,这种模拟题一定要好好纪念下 TAT #include <cstdio> #include <cstring> #include <algorithm> ...

  2. SpringMvc 系统启动时加载数据到内存中

    SpringMvc 系统启动时加载数据到内存中 学习了:http://blog.csdn.net/newstruts/article/details/18668269 https://www.cnbl ...

  3. Invalid command &#39;WSGIScriptAlias&#39;, perhaps misspelled or defined by a module not included in the ser

    没有Include wsgi,执行: sudo a2enmod wsgi 可能出现以下的错误 ERROR: Module mod-wsgi does not exist! 安装 libapache2- ...

  4. nyoj--19--擅长排列的小明(dfs)

    擅长排列的小明 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描述 小明十分聪明,而且十分擅长排列计算.比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难 ...

  5. Centos7 zabbix3.4.6的安装部署 (二)

    接着安装zabbix客户端 直接安装在服务器上 监控服务器 ip 192.168.161.25 yum -y install zabbix-agent #通过Yum安装zabbix客户端 接着配置za ...

  6. POJ 3087 模拟+hash

    也可以用map来搞 样例推出来 就没啥问题了 (先读的是B 然后是A 被坑好久) //By SiriusRen #include <cstdio> #include <iostrea ...

  7. C++中友元类使用场合

    在C++中我们可以將函数定义成类的友元函数,这样在函数中就可以访问类的私有成员.与函数相同,类也可以作为另一个类的友元类,在友元类中可以访问另外一个类的所有成员. 声明友元类的方法很简单,只需在类中写 ...

  8. 用Linux建立多应用系统备份服务器

    用Linux建立多应用系统备份服务器 本文旨在结合自己的工作实际,利用LinuxFTP服务器建立了一个多系统备份服务器异地备份策略. 1 建立LinuxFTP服务器 使用了Red Hat Enterp ...

  9. 【Redis哨兵集群】

    目录 开始配置主从复制 开始配置Redis Sentinel @ *** 在开始之前,我们先来看看Redis的主从复制 主从复制原理: 从服务器向主服务器发送SYNC命令. 主服务器接到SYNC命令后 ...

  10. 今日SGU 5.14

    //SGU 131 还没完全想清楚 留坑 SGU 259 题意:一个机器处理n个任务,每个任务有时间t和传送时间l 收获:贪心 #include<bits/stdc++.h> #defin ...