Android 如何获取微调器的下拉箭头图像资源?

Android 如何获取微调器的下拉箭头图像资源?,android,spinner,android-resources,Android,Spinner,Android Resources,我想在我正在制作的自定义控件中使用该箭头图像,有没有办法获取该资源 我知道我可以从材质设计中的图标下载类似的图标: 但是那些是黑色的,纺纱机的是灰色的。此外,如果微调器包含该资产,则该资产已包含在应用程序中,因此拥有2个几乎相同的资产会让人感觉很傻 它有ID吗?没有用于微调器下拉箭头的图像资源,它是用于btn_下拉箭头的图像资源 btn_下拉xml文件位置为: C:\Users\Administrator\AppData\Local\Android\Sdk\platforms\android-2

我想在我正在制作的自定义控件中使用该箭头图像,有没有办法获取该资源

我知道我可以从材质设计中的图标下载类似的图标:

但是那些是黑色的,纺纱机的是灰色的。此外,如果微调器包含该资产,则该资产已包含在应用程序中,因此拥有2个几乎相同的资产会让人感觉很傻


它有ID吗?

没有用于微调器下拉箭头的图像资源,它是用于btn_下拉箭头的图像资源

btn_下拉xml文件位置为:

C:\Users\Administrator\AppData\Local\Android\Sdk\platforms\android-28\data\res\drawable\btn_dropdown
其内容如下:

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_window_focused="false" android:state_enabled="true"
        android:drawable="@drawable/btn_dropdown_normal" />
    <item
        android:state_window_focused="false" android:state_enabled="false"
        android:drawable="@drawable/btn_dropdown_disabled" />
    <item
        android:state_pressed="true"
        android:drawable="@drawable/btn_dropdown_pressed" />
    <item
        android:state_focused="true" android:state_enabled="true"
        android:drawable="@drawable/btn_dropdown_selected" />
    <item
        android:state_enabled="true"
        android:drawable="@drawable/btn_dropdown_normal" />
    <item
        android:state_focused="true"
        android:drawable="@drawable/btn_dropdown_disabled_focused" />
    <item
        android:drawable="@drawable/btn_dropdown_disabled" />
</selector>
您可以在上述文件中找到特定的可绘制文件,例如:

名称:btn_dropdown_normal.9.png这是您想要的


位置:C:\Users\Administrator\AppData\Local\Android\Sdk\platforms\Android-28\data\res\drawable hdpi\

我不能完全确定您的要求。你检查过这个吗?关于图标颜色,您可以下载SVG格式的图标,在文本编辑器中打开它,并根据您的要求更改颜色,如灰色。感谢您的回复!也许我没有恰当地表达我的问题:我想获取箭头的资源id/png,并在另一个ImageView中使用它。在这种情况下,我没有微调器,我想更改它的下拉箭头图像。您可以从导入向量drawable更改颜色。它有一个像样的颜色选择工具