Android 微调器向下箭头消失在视图背景下
以下视图位于ConstraintLayout内:Android 微调器向下箭头消失在视图背景下,android,android-layout,android-spinner,Android,Android Layout,Android Spinner,以下视图位于ConstraintLayout内: <View android:layout_width="match_parent" android:layout_height="0dp" android:background="@color/white" app:layout_constraintBottom_toBottomOf="@id/pickup_date" app:layout_constraintTop_toTopOf="@id/pic
<View android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="@id/pickup_date"
app:layout_constraintTop_toTopOf="@id/pickup_date" />
<Spinner android:id="@+id/pickup_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
如您所见,它隐藏了微调器上的向下箭头
但是,如果将视图的可见性设置为消失
,则如下所示-
如何从视图中使用view删除属性应用程序:layout\u constraintop\u toTopOf=“@id/picku\u date”
实现白色背景
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<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_margin="16dp">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Select a pickup date"
android:textColor="#000"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="8dp" />
<Spinner
android:id="@+id/pickup_date"
android:layout_width="336dp"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
android:layout_marginTop="8dp"
tools:layout_editor_absoluteX="0dp" />
<View
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/white"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/pickup_date"
tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>
输出:
<?xml version="1.0" encoding="utf-8"?>
<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_margin="16dp">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Select a pickup date"
android:textColor="#000"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="8dp" />
<Spinner
android:id="@+id/pickup_date"
android:layout_width="336dp"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
android:layout_marginTop="8dp"
tools:layout_editor_absoluteX="0dp" />
<View
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/white"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/pickup_date"
tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>
希望这会有所帮助~这不是我想要的,我想要旋转器后面的白色背景/视图。不低于当我指的是上面的时候,我指的是从深度的角度。你应用了我更新的答案吗?它将在视图上显示微调器。你的观点不恰当。我可以知道否决投票的原因吗?是的,有两个原因,我在上面的评论中明确提到,我说的是深度,而不是你所做的安排。同样对于那些正在寻找答案的人来说,他们不应该走这条路,这是一种保证