Note that there are some explanatory texts on larger screens.

plurals
  1. POTable Layout isn't shown
    primarykey
    data
    text
    <p>I'm develop a dynamic table layout using java code</p> <p>the first row is in xml</p> <pre><code>&lt;TableLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:stretchColumns="*" android:id="@+id/TableMain" &gt; &lt;TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="2dip" android:background="#000000" &gt; &lt;LinearLayout android:id="@+id/lTable11" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_margin="1dip" android:layout_weight="2" android:background="#C0C0C0" android:text="Grade" android:gravity="right" android:padding="5dp" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_margin="1dip" android:layout_weight="2" android:background="#C0C0C0" android:text="Hourse" android:gravity="right" android:padding="5dp" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_margin="1dip" android:layout_weight="6" android:background="#C0C0C0" android:text="Subject Name" android:gravity="right" android:padding="5dp" /&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>the remain rows is in the java part which is have the same property in xml</p> <pre><code>TextView tvRowGrades[]=new TextView[gotSubName.length]; TextView tvRowHourse[]=new TextView[gotSubName.length]; TextView tvRowSubName[]=new TextView[gotSubName.length]; TableRow row[]=new TableRow[gotGradeItem.length]; LinearLayout LRow[]=new LinearLayout[gotGradeItem.length]; tableMain=(TableLayout)findViewById(R.id.TableMain); for(int i=0;i&lt;gotHourse.length;i++){ row[i]=new TableRow(this); TableRow.LayoutParams lRow=new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT); lRow.setMargins(2, 2, 2, 2); row[i].setLayoutParams(lRow); row[i].setBackgroundColor(Color.BLACK); LinearLayout.LayoutParams lpLRow=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT); LRow[i]=new LinearLayout(this); LRow[i].setLayoutParams(lpLRow); LRow[i].setGravity(Gravity.CENTER); LRow[i].setOrientation(LinearLayout.HORIZONTAL); tvRowGrades[i]=new TextView(this); tvRowGrades[i].setText(gotGradeItem[i]); android.widget.LinearLayout.LayoutParams lpTvOther=new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.FILL_PARENT, 2); lpTvOther.setMargins(1, 1, 1, 1); tvRowGrades[i].setPadding(5, 5, 5, 5); tvRowGrades[i].setGravity(Gravity.RIGHT); tvRowGrades[i].setLayoutParams(lpTvOther); LRow[i].addView(tvRowGrades[i]); tvRowHourse[i]=new TextView(this); tvRowHourse[i].setText(gotHourse[i]+""); tvRowHourse[i].setPadding(5, 5, 5, 5); tvRowHourse[i].setGravity(Gravity.RIGHT); tvRowHourse[i].setLayoutParams(lpTvOther); LRow[i].addView(tvRowHourse[i]); tvRowSubName[i]=new TextView(this); tvRowSubName[i].setText(gotSubName[i]); android.widget.LinearLayout.LayoutParams lpTvSubName=new android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.FILL_PARENT, 6); lpTvSubName.setMargins(1, 1, 1, 1); tvRowSubName[i].setPadding(5, 5, 5, 5); tvRowSubName[i].setGravity(Gravity.RIGHT); tvRowSubName[i].setLayoutParams(lpTvSubName); LRow[i].addView(tvRowSubName[i]); row[i].addView(LRow[i]); tableMain.addView(row[i]); } </code></pre> <p>When i run the application the table is not displaying please i want solve this problem</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload