有什么方法可以从expandablelistview的subitem做一个子项目?

时间:2014-01-28 20:24:55

标签: string listview expandablelistview subitem

有什么方法可以从expandablelistview的subitem做一个子项目? 如果有,请告诉我如何...她是我尝试做到这一点......(做第三个子项目......)。我的代码还有两个更新...

private Context context;
String [] things = {"sushi", "tells", "foods", "kids", "ice cream", "songs", "fun", "bar"};
String [][] subthings = {
        {"without fish"},
        {"teel me baby},
        {"eat", "non eat", "i love"},
        {"Burguer King", "Mc Donalds", "Willians foods"},
        {"whithout chocolate", "chocolate"},
        {"Sweet Child o mine"},
        {"kids"},
        {"cachaça", "milkshake"},
};
String [][][] subsubthings = {          //haha subsubsubthings
        {},
        {},
        {},
        {"sushi", "chocolate"},

        {},
        {},
        {},
        {},
};

添加我的代码的另一部分..

@Override
public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {

    robot = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Thin.ttf");
    TextView text = new TextView(context);
    texto.setText(title[groupPosition]);
    texto.setTypeface(robot);
    texto.setTextSize(20);
    texto.setPadding(70, 30, 0, 30);
    texto.setTextColor(Color.BLUE);


    return texto;
}

以及更多......

@Override
public View getChildView(int groupPosition, int childPosition,
        boolean isLastChild, View convertView, ViewGroup parent) {

    robot = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Light.ttf"); 
    TextView text = new TextView(context);
    text.setText(subthings[groupPosition][childPosition]);
    text.setTypeface(robot);
    text.setTextSize(15);
    text.setPadding(90, 20, 0, 20);






    return text;
}

0 个答案:

没有答案