ScrollView和微调器 [英] ScrollView and Spinner
本文介绍了ScrollView和微调器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
旋转器的骨骼"在向上滚动时显示在另一个布局的后面.当我向上滚动Spinner的箭头并显示下划线时.我希望它像将其隐藏到另一个布局的后面一样将其隐藏.
Spinner's "skeleton" shown behind another layout while scrolling up. When I scroll up Spinner's arrow and underline shown. I want it to hide it like it going to the behind of another layout.
我有两个ConstraintLayout,第二个是ScrollView.
I have a two ConstraintLayout second one for ScrollView.
这是我的XML的一部分.
Here is part of my 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设置背景颜色,例如:
Try to set a background color for the ScrollView, like:
android:background="#00FFFFFF"
请不要问我为什么它应该起作用:) 试试吧.
Please, do not ask me why it should work :) Just try it.
这篇关于ScrollView和微调器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文