Hi everyone,

I am trying to develop a simple board game for android and a custom
control for that. I extend my control from android.widget.Button and
set a default parameter in onDraw method but this parameter take
effect after displaying the button normally.

        @Override
        protected void onDraw(Canvas canvas) {
                this.setBackgroundResource(R.drawable.image1);
                super.onDraw(canvas);
        }

it is not working as same as defined in main.xml
android:background="@drawable/image1"

where is the correct place to set parameters to control.

And can I add other controls to canvas of this control what I want is
adding two textviews one of them will be the bottom of the button
other one top and upside down.

As a workaround what if I extend my control from a RelativeLayout and
add this one button and two textviews. Again I have almost the same
problem where should I set the default parameters and where should I
ass these controls.

Thanks a lot.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to