“*”是什么意思?在“@*android:color/bright_foreground_dark”中意味着?
相应的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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 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
我在这里找到了答案
添加
*
只是为了引用隐藏的 attr。I have found the answer here
Adding
*
just to reference to the attr that was hided.