带底部和顶部边框的微调框下拉菜单

时间:2020-09-02 20:00:12

标签: java android css spinner

所以我试图填充一个微调框下拉列表,但是我所获得的颜色有问题。

这是我的微调代码:

<?xml version="1.0" encoding="utf-8"?>
<TextView
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@android:id/text1"
 android:singleLine="true"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:padding="10dp"
 android:textColor="@color/white"
 android:textSize="@dimen/input_text"
 android:background="@drawable/abc_spinner_mtrl_am_alpha"/>

然后我的下拉菜单在这里:

<?xml version="1.0" encoding="utf-8"?>
<TextView
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@android:id/text1"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:padding="15dp"
 android:textColor="@color/white"
 android:background="@color/clickable_bg"
 android:textAlignment="center"/>

适配器分配的Java代码在这里:

ArrayAdapter<String> adapter = new ArrayAdapter(
            this,
            R.layout.custom_spinner,
            getResources().getStringArray(R.array.muscle_groups)
    );

adapter.setDropDownViewResource(R.layout.custom_spinner_dropdown);
spinner.setAdapter(adapter);

我得到的是以下内容:

Current Dropdown

我不想有那些白色的顶部和底部边框。我该怎么办?

0 个答案:

没有答案