English 中文(简体)
简便餐厅——如何定制儿童布局
原标题:SimpleCursorTreeAdapter - How to customize Child layout
问题回答

你可以在你简单的CursorTreeAdapter中推翻“儿童意见”。 这是我如何做的:

      class MyAdapter extends SimpleCursorTreeAdapter {

        @Override
    protected void bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) {
        // TODO Auto-generated method stub
        super.bindChildView(view, context, cursor, isLastChild);

        String title = cursor.getString(cursor.getColumnIndex(Alert.COL_DAY));              
        ((TextView)view.findViewById(R.id.child_day)).setText(title);           
    }

        public MyAdapter(Context context, Cursor cursor,
                int groupLayout, String[] groupFrom, int[] groupTo,
                int childLayout, String[] childFrom, int[] childTo) {

          super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childFrom, childTo);
        }

        protected Cursor getChildrenCursor(Cursor groupCursor) {
          int idColumn = groupCursor.getColumnIndex(Pill.COL_ID);
          return Alert.list(db, groupCursor.getInt(idColumn), null, Alert.COL_DAY);
        }

  }

然而,在创建时,你必须提供子女退学和子女退学,以适应,从而在具有约束力的意见中加以利用。





相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签