gpt4 book ai didi

android - Espresso AutoCompleteTextView 点击

转载 作者:太空狗 更新时间:2023-10-29 16:00:01 25 4
gpt4 key购买 nike

所以我最近开始在我现有的一个 Android 项目中使用 Espresso。

一切都很顺利,直到我在我的程序中找到 AutoCompleteTextView。我似乎不明白如何正确单击自动完成列表中的第一件事。实际上,我什至不确定在这种情况下使用哪个 onView()onData()

最佳答案

由于某些我不知道的原因,AStupidNoob 的解决方案不起作用。所以我又找到了一个:

onView(withText("Spinner Item"))
.inRoot(RootMatchers.isPlatformPopup())
.perform(click());

AutoCompleteTextView 本身

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<AutoCompleteTextView
android:id="@+id/product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:hint="@string/product"
android:singleLine="true"
android:textSize="16sp" />

</com.google.android.material.textfield.TextInputLayout>

关于android - Espresso AutoCompleteTextView 点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38562341/

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