【发布时间】:2019-12-02 19:58:13
【问题描述】:
我已设法使用以下代码更改微调器文本和背景颜色。
spinner_layout.xml 布局文件
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="@color/colorBlack"
android:textSize="18sp"
android:background="@color/colorWhite"
android:fontFamily="@font/raleway"/>
调用上面的kt文件
ArrayAdapter(requireContext(), R.layout.spinner_layout, companyList)
当微调器打开但关闭时,上面创建了一个带有白色文本的黑色背景,我的文本是黑底黑字,因为我的布局背景也是黑色的。如何将微调器关闭状态文本更改为白色?
【问题讨论】:
-
我是新手,所有这些都是旧代码,在 Java 中不是 Kotlin。