在我的應用程序的主要活動中,我需要一個應該看起來像PreferencesActivity中的ListPreference的控件。我的意思是,2行:右側的標題和當前值以及向下箭頭圖標。優先項目樣佈局
我試着使用TwoLineListItem此:
<TwoLineListItem android:id="@+id/twoLineListItem1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:onClick="onButtonClick" android:focusable="true"
android:background="@android:drawable/list_selector_background">
<TextView android:layout_width="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content" android:id="@android:id/text1"
android:text="Upload into:" />
<TextView android:layout_below="@android:id/text1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_alignLeft="@android:id/text1" android:layout_height="wrap_content"
android:id="@android:id/text2" android:text="<not set>"
android:layout_width="wrap_content" />
<!-- <ImageView android:layout_width="wrap_content" android:layout_alignParentRight="true"
android:id="@android:id/selectedIcon"
android:src="???"> </ImageView> -->
</TwoLineListItem>
它除了箭頭圖標的所有作品:我無法找到該系統用於其適當的資源。
這是怎麼解決的?
或者我應該使用另一個控件而不是TwoLineListItem?
或者甚至試圖實現我作爲PreferencesActivity活動(以爲我需要我的活動有一定的EditText控件)?
對於參考,我需要的是左圖: http://androinica-serve.s3.amazonaws.com/wp-content/uploads/2010/11/evernote_comp2.png
謝謝!但這並不能解決向下箭頭圖標的問題。我想重複使用一個系統(因爲它在模擬器和我的HTC設備上有所不同,所以在我的應用程序中聲明一個並不好)。可能嗎? – Forsaken 2011-05-24 14:21:23