Code example for TableRow.LayoutParams

0
	 
	public void addRecord(int rank, String name, long points){
		 
		TableRow tr = new TableRow(this);
        LayoutParams rankParamas = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT | Gravity.RIGHT);
        LayoutParams otherParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
        tr.setLayoutParams(otherParams);
 
        TextView tvLeft = new TextView(this);
        rankParamas.weight = 1.0f;
        //rankParamas.setMargins(20, 0, 40, 0); 
        tvLeft.setLayoutParams(rankParamas);
        tvLeft.setTextSize(15.0f);
        tvLeft.setText(Integer.toString(rank));
        //tvLeft.setText("1"); 
         
        TextView tvCenter = new TextView(this);
        //rankParamas.setMargins(140, 0, 0, 0); 
        tvCenter.setLayoutParams(rankParamas);
        tvCenter.setTextSize(15.0f);
        tvCenter.setText(name);