软键盘拦住文本框
软键盘挡住文本框
就行了
外层套一个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 楼
shaobin0604
2010-08-25
android:windowSoftInputMode="adjustResize"
就行了