Drawing on layout

Problems with Canvas, OpenGL, etc...

Drawing on layout

Postby rohandvora » Sat Jun 26, 2010 7:21 am

I am new to android and am designing a small application.I have to create a Table containing 81(9x9) TextViews.After that I have to draw a vertical line after every 3 elements in the column and a horizontal line after every 3 rows(just like a sudoku grid).The code:
Code: Select all
public class App extends Activity
{
       @Override
        public void onCreate(Bundle savedInstanceState)
        {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.main);
             TableLayout tl = (TableLayout)findViewById(R.id.TableLayout01);
             TableRow[] tr = new TableRow[9];
             for(int i=0;i<9;i++)
             {
                    //fill every TableRow object with 9 TextViews
                    tr[i]=new TableRow(this);
                    for(int j=0;j<9;j++)
                    {
                           TextView tv = new TextView(this);
                           tv.setText(String.valueOf(i)+","+String.valueOf(j));
                           tr[i].addView(tv);
                    }
                    tl.addView(tr[i]);
             }
      }
}

So now I have the TableLayout containing all TextViews.So now how do I draw lines on the layout?
rohandvora
Freshman
Freshman
 
Posts: 2
Joined: Fri Jun 25, 2010 1:35 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests