好的,当然我理解表达式的这一部分... listPreferredItemHeight是首选列表项高度.
但我真的没有得到这些东西......谷歌没有帮助.任何人都可以指出我正确的方向,我可以读到这个?
这也可以是对资源的引用(其形式为"@〔包:]类型:名称为")("?[包:] [类型:]名称"的形式)或主题属性包含该类型的值.
我在这里找到此代码的示例http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html
thnx in advanced
编辑:在链接的示例中,代码是 android:layout_height ="?android:attr/listPreferredItemHeight".究竟是什么意思?
Rom*_*Guy 60
标记"?" 表示您指的是样式属性.所以?android:attr/listPreferredItemHeight简单地意味着"使用名称空间android中名为listPreferredItemHeight的属性定义的值".
此属性及其值是Android框架的一部分,因此是"android"命名空间.
android:layout_height="?android:attr/listPreferredItemHeight"
?[<package_name>:][<resource_type>/]<resource_name>取自引用样式.
将?用于引用样式属性,其中作为更眼熟@是用于正常的资源.
样式属性资源引用当前应用主题中的值.因此,不同主题之间的值可能不同.
listPrefferedItemHeight返回当前应用主题的android包中找到的值android:layout_height.attr上面代码行中的资源类型是可选的,可以省略.因此,以下也是正确的:
?android:listPreferredItemHeight