在我的应用程序的主要活动中,我需要一个应该看起来像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