Spinner在向上滚动时,其“骨架”会显示在另一个布局后面。当我向上滚动时,Spinner的箭头和下划线会显示出来。我希望它像进入另一个布局的后面一样隐藏起来。
我有两个ConstraintLayout,第二个用于ScrollView。
这是我XML的一部分。
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="159dp">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:text="Cummulative GPA: 0.00"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"/>
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
app:layout_constraintVertical_bias="0.0">
<TextView
android:id="@+id/fenn1"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 1"
app:layout_constraintBottom_toTopOf="@+id/spinner"
app:layout_constraintLeft_toLeftOf="@+id/spinner"/>
<Spinner
android:id="@+id/spinner"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="8dp"
android:layout_marginTop="55dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fenn1"
/>
<TextView
android:id="@+id/label1"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 2"
app:layout_constraintBottom_toTopOf="@+id/spinner3"
app:layout_constraintLeft_toLeftOf="@+id/spinner3"/>
<Spinner
android:id="@+id/spinner3"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="43dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner"/>
<TextView
android:id="@+id/label2"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 3"
app:layout_constraintBottom_toTopOf="@+id/spinner6"
app:layout_constraintLeft_toLeftOf="@+id/spinner6"/>
<Spinner
android:id="@+id/spinner6"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="43dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner3"/>
<TextView
android:id="@+id/label3"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 4"
app:layout_constraintBottom_toTopOf="@+id/spinner7"
app:layout_constraintLeft_toLeftOf="@+id/spinner7"/>
<Spinner
android:id="@+id/spinner7"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="45dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner6"/>
<TextView
android:id="@+id/label4"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 5"
app:layout_constraintBottom_toTopOf="@+id/spinner8"
app:layout_constraintLeft_toLeftOf="@+id/spinner8"
/>
<Spinner
android:id="@+id/spinner8"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="43dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner7"/>
<TextView
android:id="@+id/label5"
style="@style/InputLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fenn 6"
app:layout_constraintBottom_toTopOf="@+id/spinner9"
app:layout_constraintLeft_toLeftOf="@+id/spinner9"/>
<Spinner
android:id="@+id/spinner9"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="40dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner8"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>