【发布时间】:2022-01-09 23:43:42
【问题描述】:
我的目标是制作带有页脚文本的登录用户界面,而且页面应该是可滚动的,只要内容不会显示在视图上。
我在布局中添加了滚动视图,但是当键盘出现时,滚动不起作用任何建议?那些不起作用,我不希望那个按钮出现在键盘上方
android:windowSoftInputMode="stateHidden|adjustPan" android:windowSoftInputMode="stateHidden|adjustResize"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".auth.AuthFragment">
<androidx.core.widget.NestedScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toTopOf="@id/footer">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/authConstraint"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/usernameInputLayout"
android:layout_width="384dp"
android:layout_height="75dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/usernameInputEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/uSubmit"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@+id/usernameInputLayout" />
<com.google.android.material.button.MaterialButton
android:id="@+id/uRegistration"
android:layout_width="match_parent"
android:layout_height="70dp"
android:backgroundTint="#2C2C2E"
android:text="SIGNIN"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/uSubmit"
app:layout_constraintStart_toStartOf="@+id/uSubmit"
app:layout_constraintTop_toBottomOf="@+id/uSubmit" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<FrameLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/black"
app:layout_constraintBottom_toBottomOf="@+id/scroll"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="358dp"
android:layout_height="wrap_content"
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
【问题讨论】:
标签: java android kotlin scroll keyboard