TableLayout lTableLayout;
lTableLayout = (TableLayout)findViewById(R.id.tblayout);
for(int i=0;i<10;i++){
TableRow tr1 = new TableRow(this);
tr1.setPadding(0, 5, 0, 0);
lTableLayout.addView(tr1, LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
TextView tv11 = new TextView(this);
tv11.setPadding(2, 0, 0, 0);
tv11.setTextSize(12);
tr1.addView(tv11,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); // Can give width and height in numbers also.
}
이 촬영 테이블의 각 행에서 10 행과 1 텍스트 뷰를 만들 것입니다 볼 수 있습니다 형세. 다음과 같이 xml 파일에서 하나의 표 레이아웃을 사용하십시오.
<TableLayout
android:id="@+id/tblayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</TableLayout>
코드를 통해 하시겠습니까? 또는 XML을 통해? – Dhruvisha
무엇이든 괜찮습니다. – Nini