我试图奇怪地改变工具栏微调器下拉主题这没有发生.当我点击微调器时,它总是会变暗.我想背景为灰色,文字为黑色.
我没有任何动作栏.我通过工具栏设置一切.
因此我尝试了以下方法:
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
android:id="@+id/relativeLayoutID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="left|center"
android:text="@string/register_title"
android:textColor="@color/whiteText"
android:textSize="@dimen/text_size_medium" />
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="80dp"
android:spinnerMode="dropdown"
android:visibility="gone" />
风格xml:
@color/numbertext
@color/colorPrimaryDark
@color/colorPrimary
@drawable/toolbar_dropshadow
@android:color/white
@android:color/background_dark
@android:color/background_dark
@android:color/background_dark
@color/orangeText
@color/orangeText
@color/colorPrimary
?android:selectableItemBackground
?android:selectableItemBackground
@color/blackText
true
更新:
添加了以下主题:
?android:selectableItemBackground
@color/layoutbackground
?android:selectableItemBackground
@color/blackText
true
并将其应用于微调器:
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="80dp"
style="@style/MyDarkToolbarStyle"
android:spinnerMode="dropdown"
android:visibility="gone" />
使用上面的设置,我可以更改下拉背景颜色但不能在将主题应用到微调器之前,我不能对选择产生涟漪效应吗?