0

enter image description here

I am using the button as the side tab menus for item like 'Home','Games',etc. I can't figure out how to get such rectangle shape selection when button is pressed. Can I use drawable res for the same. Please help.

Magzy
  • 73
  • 9
Kundan Jha
  • 104
  • 3
  • 11

1 Answers1

1

You should use a custom drawable with left margin rectangle drawable 1dp to 5dp width. I think you already have the logic for toggling the current tab's button to only have this drawable.

Abishek Stephen
  • 386
  • 1
  • 3
  • 15
  • Yes, I have the logic for drawable selection on the toggle. Can you please elaborate a little like what should I use selector, shape or should create a layout for the same in drwable? – Kundan Jha Sep 12 '21 at 14:19
  • You can refer the answer here for code https://stackoverflow.com/questions/7690416/android-border-for-button – Abishek Stephen Sep 12 '21 at 14:29