1

对应的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>

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

4

2 回答 2

0

我在这里找到了答案

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

于 2012-02-08T01:27:16.757 回答
0

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

@[package:]color/filename

据推测,*不需要,它只是匹配所有包。

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

于 2012-02-06T05:00:26.230 回答