0

Is there any solutions for this problem :

I want these two shapes with blue and pink colors to be separate buttons so whenever the pink space is clicked something happened and the same for the blue space.

PS: i can slice the two portions and create an ImageButton for each but the problem is the button doesn't take the same shape of a portion it is always rectangular so i can't place the other button next to it

enter image description here

ceferino
  • 61
  • 1
  • 6

2 Answers2

0

I'd suppose to recommend you to write a custom View, that draw this picture itself, depending on some kind of formulae.

Or use an old method of game development when you define color of pixel that was touched or focused. Define color of pixel touched

0

PS: i can slice the two portions and create an ImageButton for each but the problem is they don't fit good on the activity

Try to use 9 patch resources or svg drawables instead. If they are defined well it should work.

Then you will have to write you're own custom button the uses them.

You can read more about it here: http://www.vogella.com/tutorials/AndroidDrawables/article.html#9-patch-drawables http://www.vogella.com/tutorials/AndroidDrawables/article.html#vector-drawables

Sagi Mymon
  • 958
  • 9
  • 12