2

I would like to create button which contains text on left and checkbox on right (or any other component). How can I do that?

As I found I can make my own View extends Button, but how should I implement onDraw method if so?

Thanks

davs
  • 9,226
  • 8
  • 41
  • 54
  • 1
    This isn't an answer, just a suggestion. Think of the usability of such a component. Will it be intuitive to the use whether they are clicking the button or the check box? Is the checkbox simply to show the user the state of the button? If so, then maybe you should have a look at `ToggleButton`. – CaseyB Jun 21 '10 at 17:20
  • You're right. It simply, but I was asked to make button, I have described (with smth like checkbox) – davs Jun 22 '10 at 09:35

1 Answers1

3

There's an easier solution, look at this post: Android: combining text & image on a Button or ImageButton

Community
  • 1
  • 1
cristis
  • 1,986
  • 16
  • 22
  • Thanks. It helped. I have solve the issue using setCompoundDrawableWithInstrictsicBounds(int, int , int , int) – davs Jun 22 '10 at 09:37