views:

27

answers:

1

I have a layout like :

<ll vertical>
<ll horizental>
<textview></textview>
<textview></textview>
</ll>
<ll horizental>
<textview></textview>
<textview></textview>
</ll>
</ll>

The problem is i need to display this as part of my whole screen.

i am doing

    mCustomDrawableView = new CustomDrawableView((Context)this, R.drawable.mychart);
    setContentView(mCustomDrawableView);

and on ondraw of my custom view i am drawing the bitmaps etc.

The problem is how can I make above layout into a ibitmap, so that I can draw it in this custom drawing ?

I need to do this because in the layout, one TextView will have right aligned text which is difficult to do in custom drawing.

A: 

You should be able to inflate the layout and build the paramaters/child-text-views you want. Then, create a Canvas from your own Bitmap and call the layout's 'draw' function passing in your own canvas. The layout should then blit all of it's children into your custom bitmap, which, you can then do whatever you want with.

http://developer.android.com/reference/android/view/View.html#draw(android.graphics.Canvas)

haseman