我正在尝试在我的应用程序上实现一个下拉菜单,但是每当我尝试为样式选择任何材料选项时,它都会使整个 activity_main.xml 消失。
我之前在其他项目中做过,我在最终应用程序中实施之前用来测试东西并且它们有效,我寻找项目之间的任何差异但我没有找到任何差异。
这是 activity_main.xml 中的代码片段
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:layout_weight="1">
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="none"
android:text="Chose level and press play"
android:gravity="center"
android:fontFamily="@font/gomarice_coffee_jelly_umai"
android:textSize="30sp"/>
</com.google.android.material.textfield.TextInputLayout>
这是我遵循的教程:https://www.geeksforgeeks.org/exposed-drop-down-menu-in-android/
我已经尝试了每一种材料设计,名称为下拉菜单。 我期望的是显示一个下拉菜单。 我还遇到了下拉菜单所需的其他 .xml 文件的问题
这是我第一次问,希望问题足够清楚,对于语言错误,我很抱歉,我来自西班牙。