在创建一个ListView类? [英] Creating categories in a ListView?

查看:102
本文介绍了在创建一个ListView类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何创建一个任意的ListView像那些在preferences类别(preferenceCategory)?

我发现 android.R.layout。preference_category 呈现的灰色TextView中却看不到它与Java code提到的任何地方。

解决方案
  
    

我如何在任意的ListView像那些在创建类别     preferences(preferenceCategory)?     我发现android.R.layout。preference_category     呈现的灰色     TextView中却看不到它与Java code提到的任何地方。

  
     

<一个href="http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/">http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/

     

请注意,code是安卓0.9   并且可能需要少量修改   在Android 1.5的工作。

     

我有一个Android 1.5兼容   变体在他的code起来的:

     

http://commonsware.com/AdvAndroid/

     

(向下滚动,点击来源$ C ​​$ C   链接,并期待在   ListView控件/部分项目)

     

- 马克·墨菲(下议院人) http://commonsware.com   的忙碌codeR指南Android的发展的2.0版本可用!

谢谢,马克!

How do I create categories in an arbitrary ListView like those in Preferences (PreferenceCategory)?

I've found android.R.layout.preference_category that renders that grey TextView but don't see it mentioned anywhere from java code.

解决方案

How do I create categories in an arbitrary ListView like those in Preferences (PreferenceCategory)? I've found android.R.layout.preference_category that renders that grey TextView but don't see it mentioned anywhere from java code.

http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/

Note that the code is from Android 0.9 and may require minor modifications to work in Android 1.5.

I have an Android 1.5-compatible variant on his code up at:

http://commonsware.com/AdvAndroid/

(scroll down, click on the Source Code link, and look at the ListView/Sections project)

-- Mark Murphy (a Commons Guy) http://commonsware.com The Busy Coder's Guide to Android Development Version 2.0 Available!

Thanks, Mark!

这篇关于在创建一个ListView类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆