0

使用する:

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;
}

ただし、グリッドビューは完全には表示されません。なんで?

スクリーンショット:
ここに画像の説明を入力

そして、私はこれが好きです:
ここに画像の説明を入力

item.xml

4

0 に答える 0