外层套一个ScrollView <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:background="@drawable/bg" android:layout_height="fill_parent" android:orientation="vertical"> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"      android:layout_width="fill_parent"      android:layout_height="fill_parent"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent" android:orientation="vertical"> </RelativeLayout></ScrollView></LinearLayout> AndroidManifest.xml 相应的activity加入属性android:windowSoftInputMode="adjustPan"

今天做一个相机加一个文本框布局,文本在下面怎么输入,一输入软键盘把文本框挡住,在网上goole,找到上面一种方法,不行,于是翻网页找,终于解决。

代码方式:  getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE |                 WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);   xml方式: <activity android:name=".Activity.FilterActivity" android:label="@string/app_name" 
 android:windowSoftInputMode="stateHidden" android:screenOrientation="portrait" 
android:configChanges="keyboardHidden|orientation"            /> 

更多相关文章

  1. Android WebView与 JS 的交互方式
  2. Android 启动栈管理方式 (二)
  3. Android全屏显示的两种方式
  4. 在Android Studio中下载Android SDK的两种方式(Android Studio3.0
  5. activity的android:name类名的简写方式
  6. android调用系统自带资源的两种方式
  7. android TabHost导航切换实现方式
  8. Android 实现动画方式
  9. android studio 在线更新android sdk,遇到无法Fetching https://d

随机推荐

  1. thinkphp5使用workerman定时器定时爬取某
  2. 通过 javascript和php 实现打印问题
  3. 如何在PDO中使用RLIKE来转义星号和问号?
  4. php 读取文本文件
  5. 如何打开名称中包含特殊字符的文件
  6. 国内外常用wiki程序汇总
  7. 用Hack编写的代码比在HHVM上用PHP编写的
  8. NFS共享上的“stat failed”问题
  9. 在数组中找到键是找不到文本[重复]
  10. php实现邮件自动发送之PHPMailer