you're calling canvas.restore() which clears out all changes since the
last call of canvas.save()
I'd try taking out that line.

On Jul 2, 8:57 pm, Casper <[email protected]> wrote:
> public class TCheckBox extends CheckBox{
> public void onDraw(Canvas canvas){
>
>                Paint tTextPaint = new Paint();
>                 tTextPaint.setColor(Color.BLACK);
>
>                 canvas.drawText("mtext1", getPaddingLeft(), getBottom(),
> tTextPaint);
>
>                 int width = getWidth();
>
>                 Paint tTextPaint2 = new Paint();
>                 tTextPaint2.setColor(Color.BLACK);
>                 int tSize = (int)tTextPaint2.measureText("$0000.00");
>                 canvas.drawText("mtext2", width - tSize, getBottom(), 
> tTextPaint2);
>                 canvas.restore();
>  }
>
> }
>
> public void renderCheckBox(){
>  mTCheckBox[mCheckBoxCounter] = new TCheckBox(this);
>
>                            if(mTCheckBox[mCheckBoxCounter] != null){
>
>                                
> linearLayout.addView(mTCheckBox[mCheckBoxCounter]);
>                                mCheckBoxCounter++;
>                            }
>                            sView.postInvalidate();
>                    }
>   }
>
> My first call to renderCheckBox could render the check box with text1,
> and text2. From second time onwards, my text is not being rendered but
> the checkBox is getting rendered. I am not knowing what might be the
> reason for the failure. Could some one help with this problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to