有一个滚动视图&线性布局内的按钮(位于底部)。工具栏固定为屏幕。键盘打开时,按钮向上移动。我希望按钮不会向上移动。
答案 0 :(得分:1)
使用以下代码更改manifest.xml
,, xml布局包含活动。
android:windowSoftInputMode="stateUnchanged|adjustResize"
OR
android:windowSoftInputMode="adjustPan|adjustResize"
更改MANIFEST FILE
<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>
希望这会对你有所帮助。让我知道如果解决了。
答案 1 :(得分:0)
如果您正在使用Fragment,请在 onCreateView 中编写以下代码:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
答案 2 :(得分:0)
在XML文件中,您可以使用ScrollView:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--your layout-->
</ScrollView>
答案 3 :(得分:0)
确保您的活动在AndroidManifest.xml
android:windowSoftInputMode="adjustResize"
同样在布局xml文件中,LinearLayout
作为Button
和EditText
的父级。
答案 4 :(得分:0)
此问题涉及该活动的清单属性。
你是否在下面的清单中添加了任何属性?
<a href="{{ url('admin/offices/' . $customer->id) }}">
<div class="float-left">
<button class="btn btn-success btn-xs">Create office</button>
</div>
</a>
或者
Route::get('/', function () {
return view('/auth/login');
});
Route::auth();
Route::get('/home', 'HomeController@index');
Route::resource('admin/users', 'AdminUsersController');
Route::resource('admin/customers', 'AdminCustomersController');
Route::resource('admin/offices', 'AdminOfficesController');
Route::resource('admin/labourentries', 'AdminLabourentriesController');
Route::resource('admin/labourtypes', 'AdminLabourtypesController');
Route::get('/admin/dashboard', 'AdminCustomersController@dashboard');
Route::get('admin/offices/{customer_id}/create', 'AdminOfficesController@create');