2011-04-12 97 views
0

我想要使用這種風格,這是一個Android版本風格屬性,但它不會編譯。我錯過了某種導入?在自己的佈局中使用Android風格的屬性

?android:attr/listItemFirstLineStyle 

<TextView 
     android:id="@+id/text" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" android:layout_gravity="left|center_vertical" style="?android:attr/listItemFirstLineStyle" android:layout_marginLeft="10dip"/>` 

THX

回答

2

你嘗試刪除的問號?

style="android:attr/listItemFirstLineStyle"

+0

「?」當你想訪問構建屬性時是必需的 – 2011-04-12 08:05:21

0

無法訪問所有建立在自己的項目風格。當您在Eclipse中

style="@android:style/" 

到目前爲止輸入,然後按Ctrl +回車,智能感知應該給你的,你可以使用什麼樣的概述。樣式名稱中有下劃線,將其替換爲'。'..