2011-01-12 52 views
3

解释这里是布局文件需要为Android布局语法

<TextView android:id="@+id/username" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/username" android:textAppearance="?android:attr/textAppearanceMedium">
约背景是什么
android:textAppearance="?android:attr/textAppearanceMedium"
的确切含义的线路是,相关 “[包:] [类型:]名”,如果是的话那是指什么?

+0

我们'?'用于 ?我们还可以定义相同的东西吗? 我们如何定义一个新的包? – Shrenik 2011-01-12 13:46:03

回答

7

?android:attr/textAppearanceMedium指的是android.R.attr.textAppearanceMedium这是引用外部包资源内容的方式。

这里是一个article提到这一点。