0

I want to have a button like the one in the link below. How can i achieve it just by java code or xml? By the way it's going to be of a different color when pressed. I've explored similar posts but none helped. Any help appreciated.

The button which i want

image

Madhur
  • 3,303
  • 20
  • 29
solo
  • 69
  • 1
  • 7
  • What has not helped you? Which posts did you find? Where **exactly** lies your problem? _What have you tried so far?_ – yennsarah Feb 19 '16 at 06:25

1 Answers1

0

Just make a View with large rectangle and add what you want(e.g. Label contains 'Number Of Students' and/or something else) in the view.

Then, add onClickListener to the View.

To change clicked colour, refer to here

Community
  • 1
  • 1
Alfred Woo
  • 648
  • 1
  • 6
  • 23
  • So seems there is no way to do so without turning from buttons to views! because i have a lot of buttons which now i must change all of them to views! – solo Feb 19 '16 at 06:56
  • Then, why don't you create a custom view like that? That will definitely save your time and simplify your code. – Alfred Woo Feb 19 '16 at 06:57
  • Fair enough. I'm going to do so. Thanks for answering and not complaining about details XD – solo Feb 19 '16 at 07:19