JayceLi  

首先要有一个普通的layout,里面必须包含

1 <ListView android:id="@android:id/list"  
2         android:layout_width="fill_parent"   
3         android:layout_height="wrap_content"></ListView> 

ListView的id必须是android:id/list.

然后layout里可以加其他的普通的控件了。

JAVA代码里使用的时候是

1 addPreferencesFromResource(R.xml.preference);  
2 setContentView(R.layout.test_preference);  

然后对其他控件和preference做操作即可。

posted on 2012-09-08 11:20  JayceLi  阅读(231)  评论(0编辑  收藏  举报