软键盘挡住文本框
16lz
2021-01-23
外层套一个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 启动栈管理方式 (二)
- Android全屏显示的两种方式
- 在Android Studio中下载Android SDK的两种方式(Android Studio3.0
- activity的android:name类名的简写方式
- android调用系统自带资源的两种方式
- android TabHost导航切换实现方式
- Android 实现动画方式
- android studio 在线更新android sdk,遇到无法Fetching https://d