ビューを使用する代わりに、カスタムビューを作成してこれを描画してみることができると思います。
新しいクラスでViewクラスを拡張し、onDrawメソッドをオーバーライドします。
//variables
Paint paint[]; //Set up these paints with the colors you need
int rowWidth, int colHeight;
void onDraw(Canvas c){
for(int i=0;i<noOfRows;i++){
for(int j=0;j<noOfColumns;j++){
if(cellRequired(i,j)){
//cellRequired will be whatever logic you have to check if cell is required
int rectHeight=colHeight; //Now the Rect Height changes whether the cell
// below is in use or not.
for(int k=i;k<noOfRows;k++){
//This loop will run through the rows and see if merging is required
if(cellRequired(i,k))
rectHeight+=colHeight; //Merge Cell
else
break; //If not required at any point break loop
}
//Draw Rectangle background
c.drawRect(i*rowWidth +i, j*colHeight +j, rowWidth, rectHeight, backPaint);
//Draw Text
canvas.drawText("Text",i*rowWidth +i, j*colHeight +j, paint[requiredPaint]);
//I added the plus i and plus j so there'd be a gap in the rectangles
// Then it will be a border
}
}
}
}
カスタムコントロールに関するAndroidのドキュメント
Android:カスタムビュー作成のチュートリアル
上記のようなカスタムビューを作成する方法
http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html
これらを確認してから、上記のコードを確認してください。うまくいけば、それはそれを実装する方法をあなたに示すはずです。