gpt4 book ai didi

android - ScrollView 和微调器

转载 作者:行者123 更新时间:2023-12-04 03:04:59 24 4
gpt4 key购买 nike

微调器的“骨架”在向上滚动时显示在另一个布局后面。当我向上滚动 Spinner 的箭头并显示下划线时。我希望它像隐藏到另一个布局的后面一样隐藏它。

before scrolling

after scrolling

我有两个 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>

最佳答案

尝试为 ScrollView 设置背景颜色,例如:

android:background="#00FFFFFF"

请不要问我为什么它应该有效:)试试吧。

关于android - ScrollView 和微调器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45442578/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com