- public static final int listPreferredItemHeight
好的,我当然理解这部分表达式...listPreferredItemHeight 是首选列表项高度。
但我真的不明白这些东西。任何人都可以指出我可以阅读的正确方向吗?
This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.
我在此处找到此代码的示例 https://android-developers.googleblog.com/2009/02/android-layout-tricks-1.html
编辑:在链接的示例中,代码是 android:layout_height="?android:attr/listPreferredItemHeight"
。究竟是什么意思?
最佳答案
标记“?”表示您指的是样式属性。所以?android:attr/listPreferredItemHeight
简单的意思是“使用命名空间android中名为listPreferredItemHeight的属性定义的值。”
此属性及其值是 Android 框架的一部分,因此是“android”命名空间。
关于java - 什么?android :attr/listPreferredItemHeight is doing and how?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7923221/