?android:attr/selectableItemBackground

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10970350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:35:50  来源:igfitidea点击:

?android:attr/selectableItemBackground

androidandroid-layoutandroid-xml

提问by Maxwell Weru

when writing my android app i used

在编写我的 android 应用程序时,我使用了

android:background="?android:attr/selectableItemBackground"

I tried looking for attr.xml file that would be containing the source but i could not find it. Any ideas please on where i can find it. I found one attr.xml in

我试图寻找包含源代码的 attr.xml 文件,但我找不到它。任何想法请告诉我在哪里可以找到它。我在其中找到了一个 attr.xml

C:\Program Files (x86)\Android\android-sdk\platforms\android-13\data\res\values

C:\Program Files (x86)\Android\android-sdk\platforms\android-13\data\res\values

but it did not have the attribute mentioned above. Can anyone lead me where I can find the xml resource with the attribute above?

但它没有上面提到的属性。任何人都可以引导我在哪里可以找到具有上述属性的 xml 资源?

回答by Gautam

I'm not that experienced with Android, but I think you can find what you're looking for in "data\res\values\themes.xml".

我对 Android 不是很有经验,但我认为您可以在"data\res\values\themes.xml" 中找到您要查找的内容。

If you search in that file for "selectableItemBackground", you should find the following:

如果您在该文件中搜索"selectableItemBackground",您应该找到以下内容:

<style name="Theme">
...
        <item name="selectableItemBackground">@android:drawable/item_background</item>
...
</style>

You'll also find respective entries for Theme.Holo.Lightand Theme.Holo. The *"item_background"*, *"item_background_holo_light"*, and *"item_background_holo_dark"* drawables would be located in the "data\res\drawable"folder.

您还将找到Theme.Holo.LightTheme.Holo 的相应条目。*"item_background"*、*"item_background_holo_light"* 和 *"item_background_holo_dark"* 可绘制对象将位于“data\res\drawable”文件夹中。

Hope that helps!

希望有帮助!