0

use:

public View getView(int position, View convertView, ViewGroup parent) {
final int type = getItemViewType(position);

if(position == 1){
    GridView gridView = new GridView(context);
    gridView.setNumColumns(3);
    AbsListView.LayoutParams params = new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
    gridView.setLayoutParams(params);
    ArrayAdapter<String>  adapter = new ArrayAdapter<String>(context, R.layout.item, R.id.tvText, new String[]{"as","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah","ah"});
    gridView.setAdapter(adapter);
    return gridView;
}

but the gridview is not shown in full. Why?

screenshot:
enter image description here

and I should like this:
enter image description here

item.xml

slip.08
  • 1
  • 2

0 Answers0