Create a new class (can be named for ex CustomListAdapter) that
extends BaseAdapter, and do your customized in "public View getView
(int position, View convertView, ViewGroup parent)". Ex:
@Override
        public View getView(int position, View convertView, ViewGroup parent)
{
                TextView tv;
                if(convertView == null){
                        tv = new TextView("Any text");
                } else {
                        tv = (TextView) convertView;

                }
                if(position % 2 == 0){
                     //set text underline for tv here (can use
Spannable)
                }

                return tv;
        }

Good luck :)

On May 22, 11:36 am, stonestrange <stonestra...@gmail.com> wrote:
> hi,
> I am trying to have a list in my app. In the list,there are two
> columns,the first is DbAdapter.KEY_ID,and the second is
> DbAdapter.KEY_PROJECT. That is every item has two
> fields,DbAdapter.KEY_ID, DbAdapter.KEY_PROJECT. These data all come
> from database,and DbAdapter.KEY_ID's layout is defined in
> R.id.text1,and DbAdapter.KEY_PROJECT's layout is defined in
> R.id.text2.
>
> I want have some special for each item,that is ,some items have
> underline,while some have not underline.Who can tell me how to solve
> it,thank you.:-)
>
> the code is like this:
> private void fillData(ListView projectList) {
>                 prjCursor = gtdDbHelper.fetchAllProject();
>                 startManagingCursor(prjCursor);
>
>                 String[] from = new String[] { DbAdapter.KEY_ID,
> DbAdapter.KEY_PROJECT};
>                 int[] to = new int[] { R.id.text1, R.id.text2};
>
>                 SimpleCursorAdapter prjSCA = new SimpleCursorAdapter(this,
>                                 R.layout.listrow, prjCursor, from, to);
>                 projectList.setAdapter(prjSCA);
>
>         }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to