“*”是什么意思?在“@*android:color/bright_foreground_dark”中意味着?

发布于 2025-01-02 22:43:47 字数 985 浏览 1 评论 0原文

相应的xml文件的内容是“@*android:color/bright_foreground_dark”是

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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:color="@*android:color/bright_foreground_dark" />
</selector>

我的问题是“*”的用途是什么。我以前没见过,自己参考也找不到。
谢谢。

The content of the corresponding xml file is "@*android:color/bright_foreground_dark" is

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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:color="@*android:color/bright_foreground_dark" />
</selector>

My question is what does "*" used for. I haven't seen it before and can't found it in reference by myself.
thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉生梦死 2025-01-09 22:43:47

在 xml 布局文件中,定义颜色的语法为:

@[package:]color/filename

大概不需要 *,它只是匹配所有包。

http://developer.android.com/guide/topics/resources /color-list-resource.html

In an xml layout file, the syntax for defining a color is:

@[package:]color/filename

Presumably, the * is not needed and simply matches all packages.

http://developer.android.com/guide/topics/resources/color-list-resource.html

从此见与不见 2025-01-09 22:43:47

我在这里找到了答案

添加 * 只是为了引用隐藏的 attr。

I have found the answer here

Adding * just to reference to the attr that was hided.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文