我正在尝试扩展Android的simple_list_item_2,所以我复制了它的XML,它是:
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/listPreferredItemHeight"
android:mode="twoLine"
android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingEnd="?attr/listPreferredItemPaddingEnd">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="?attr/textAppearanceListItem" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/text1"
android:layout_alignStart="@id/text1"
android:textAppearance="?attr/textAppearanceListItemSecondary" />
在我的实施中,问题是这条线
android:textAppearance="?attr/textAppearanceListItemSecondary"/>
给出错误:
Cannot resolve symbol ?attr/textAppearanceListItemSecondary
我试过像这样的东西:
android:textAppearance="android:?attr/textAppearanceListItemSecondary"
和
android:textAppearance="@android?attr/textAppearanceListItemSecondary"但它不起作用
所以我的问题是,如何访问Android SDK资源中的布局可以访问的相同符号/属性?我是否需要将符号复制到我的应用程序目录,或者我可以简单地访问simple_list_item_2所做的那个?
此外,原来的simple_list_item_2位于C:Androidsdkplatformsandroid-23dataeslayout,我的实施位于appsrcmaineslayout,如果它有帮助