我試圖擴大Android的simple_list_item_2
屬性,所以我複製它的XML,它是:Android的訪問SDK中的XML
<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
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">
<TextView android:id="@id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView android:id="@id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/text1"
android:layout_alignStart="@id/text1"
android:textAppearance="?attr/textAppearanceListItemSecondary" />
</TwoLineListItem>
的問題是,在我的實現,該行
android:textAppearance="?attr/textAppearanceListItemSecondary"/>
給出了錯誤:
Cannot resolve symbol ?attr/textAppearanceListItemSecondary
我試過的東西LIK E:
android:textAppearance="android:?attr/textAppearanceListItemSecondary"
和
android:textAppearance="@android?attr/textAppearanceListItemSecondary"
,但它不工作
所以我的問題是,我怎麼能訪問相同的符號/屬性,在Android SDK中資源佈局可以訪問?我是否需要將該符號複製到我的應用程序目錄中,或者我可以簡單地訪問simple_list_item_2
所做的那個符號嗎?
而且,原來simple_list_item_2
位於C:\Android\sdk\platforms\android-23\data\res\layout\
和我實現它位於\app\src\main\res\layout
如果它可以幫助
哎,我只是用Google搜索這個,來到這裏,然後意識到這是我自己問題,我去年問了 – Parker