软键盘挡住文本框
16lz
2021-12-04
外层套一个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" />
更多相关文章
- Android(安卓)WebView与 JS 的交互方式
- 如何在Android上安装apk软件
- Android之Button按钮
- android中使用 EditText 时,设定 inputType的一点说明
- 【Android常用控件】EditText常用属性【二】:为文本输入框指定软
- 【Android】EditText标签调用键盘
- ANDROID 输入法出现挤压屏幕、ANDROID输入键盘覆盖了屏幕控件的
- Android(安卓)SDK 证书没接受问题
- edittext底部输入