0
        // programmatically creating grid on run time
        int z=0;
        if(Integer.valueOf(sing.questionsObjectArr[index].noOfcolumns) > Integer.valueOf(
                sing.questionsObjectArr[index].noOfrows)){
            while(z < Integer.valueOf(sing.questionsObjectArr[index].noOfcolumns)){
                gridEdittext.add(new ArrayList<TextView>());
                z++;
            }
        }
        else{
            while(z < Integer.valueOf(sing.questionsObjectArr[index].noOfrows)){
                gridEdittext.add(new ArrayList<TextView>());
                z++;
            }
        }

        for(int x = 0; x < Integer.valueOf(sing.questionsObjectArr[index].noOfrows); x++){

                this.ll = new LinearLayout(this);
                this.ll.setLayoutParams(new LinearLayout.LayoutParams(
                        LinearLayout.LayoutParams.WRAP_CONTENT,
                        LinearLayout.LayoutParams.WRAP_CONTENT));
                this.ll.setOrientation(0);

            for(int y = 0; y < Integer.valueOf(sing.questionsObjectArr[index].noOfcolumns); y++){

                if(y==0){
                    this.gridEdittext.get(y).add(new TextView(this));
                    this.gridEdittext.get(y).get(x).setId(y);
                    this.gridEdittext.get(y).get(x).setTextColor(Color.BLACK);
                    if(x!=0){
                        this.gridEdittext.get(y).get(x).setText(
                                sing.questionsObjectArr[index].columnData.get(x-1).toString());
                    }
                    else{
                        this.gridEdittext.get(y).get(x).setText(
                                sing.questionsObjectArr[index].rowData.get(x).toString());
                    }
                    LinearLayout.LayoutParams colparams = new LinearLayout.LayoutParams(60, 60);
                    colparams.setMargins(20, 0, 20, 0);
                    this.gridEdittext.get(y).get(x).setLayoutParams(colparams);
                    this.ll.addView(this.gridEdittext.get(y).get(x));
                    y++;
                }
                if(x==0){
                    this.gridEdittext.get(y).add(new TextView(this));
                    this.gridEdittext.get(y).get(x).setTextColor(Color.BLACK);
                    this.gridEdittext.get(y).get(x).setId(y);
                    this.gridEdittext.get(y).get(x).setText(
                            sing.questionsObjectArr[index].rowData.get(y).toString());
                    LinearLayout.LayoutParams colparam = new LinearLayout.LayoutParams(60, 60);
                    colparam.setMargins(0, 0, 20, 0);
                    this.gridEdittext.get(y).get(x).setLayoutParams(colparam);
                    this.ll.addView(this.gridEdittext.get(y).get(x));
                }
                else{
                    this.gridEdittext.get(y).add(new EditText(this));
                    this.gridEdittext.get(y).get(x).setId(y);
                    this.gridEdittext.get(y).get(x).setText("");
                    this.gridEdittext.get(y).get(x).setLayoutParams(new LinearLayout.LayoutParams(80, 80));
                    this.ll.addView(this.gridEdittext.get(y).get(x));
                }
            }
            tlayout.addView(this.ll);
            tlayout.setBackgroundResource(R.drawable.roundshape);
        }

データを受け入れることができる動的グリッドを作成しEditTextています。テーブルはTextViewで囲まれています。問題は、TextViewのテキストがAndroid 2.3で完全に表示されているが、Android4.0では表示されていないことです。

4

1 に答える 1

0

私は SAX 解析を使用していましたが、うまく機能していましたが、Android 4.0 では、インターネット サーバーからのラベルにテキストが表示されませんでした。次に、解析手法を DOM 解析の問題に変更しました。

于 2012-11-18T12:46:56.347 に答える