在线性布局中有一个滚动视图和按钮(在底部)。屏幕的工具栏是固定的。当键盘打开时,按钮向上移动。我不想让按钮向上移动。
发布于 2016-08-02 18:09:16
使用下面的代码来更改您的manifest.xml,它的xml布局包含活动。
android:windowSoftInputMode="stateUnchanged|adjustResize"或
android:windowSoftInputMode="adjustPan|adjustResize"清单文件中的更改
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.adjustscroll.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateUnchanged|adjustResize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>希望这能对你有所帮助。如果问题解决了,请告诉我。
发布于 2016-08-02 18:06:40
如果您使用的是片段,请在onCreateView中编写以下代码
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);发布于 2016-08-02 18:10:36
在XML文件中,您可以使用ScrollView:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--your layout-->
</ScrollView>https://stackoverflow.com/questions/38717464
复制相似问题