Code example for TableLayout

Methods: setGravityaddView

0
		lLayout.addView(date);	//LinearLayoutに追加
	} 
	 
	private void createHeader(){ 
		//ヘッダー作成 
		tLayout = new TableLayout(this);
		tLayout.setGravity(Gravity.CENTER_HORIZONTAL);
		TableRow head = new TableRow(this);
		head.setPadding(20, 0, 0, 40);
		TextView hName = new TextView(this);
		hName.setText("品物名");
		hName.setTextSize(25);
		head.addView(hName);
		 
		TextView hNum = new TextView(this);
		hNum.setText("数量");
		hNum.setTextSize(25);
		hNum.setGravity(Gravity.CENTER_HORIZONTAL);
		head.addView(hNum);
		tLayout.addView(head);
	} 
	 
	private void createOrderedList(String itemName, String itemNum){
		//おねがい情報生成 
		TableRow row = new TableRow(this);