Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Holly Fox
2,808 PointsCan you over lay a shape over a button?
I've done quite a bit of searching already and I don't know if this is at all possible so hoping Tree House can help or point me in the right direction.
Could this work.... There's a button which completely fills the screen and changes colour when clicked. Imagine a white screen overlaying this with a shape cut out, let's say a star. The cut out is transparent so the colour behind is still showing. Can the button still work and show the star in different colours?
The above is just a simple example of an idea I have. I'd prefer not to just use drawables as I still want to manipulate the colours used in a varible.
Is this at all possible? Or should I rethink? I'm a beginner so still finding my feet. :)
1 Answer
Holly Fox
2,808 PointsI've done it! I imported an image into my drawable files and then just associated the onClickListener method to this drawing. All the code I had running in the background still works perfectly!