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 trialAlex Abdo
872 PointsButton and text still transparent and dark with Theme Error Fix
Android Development --> Stage 3 --> Pretty Little Things --> Adding an Image
So I have tried all 3 different ways to fix the Theme Error in this lesson, but none of them have worked. I have tried Importing the Project Files, copying and pasting in the styles.xml and activity_main.xml to my project, and manually following the steps provided.
Yet, the "Enlighten Me!" button is still partially transparent and the fortune text is still a dark grey.
Is there any other way that could fix the theme?
3 Answers
John Shepherd
Courses Plus Student 437 PointsTry to change the button's background property to @android:drawable/btn_default
Matheus G Oliveira
9,682 PointsHey Alex,
Did you put the style on the xml file for the items you want to add?
FOr example
If you have a style like this
<style name="RibbitButton">
<item name="android:textColor">#0000FF</item>
</style>
So you should call it from the xml file like this
<Button
style="@style/RibbitButton"
... />
Matthew Schmitt
12,234 PointsI'm having the same problem as well. On the next video customizing buttons and labels, it will show you how to fix the dark text.
However, my button is still transparent. Not sure if anyone know how to fix that? I haven't found the answer yet.
Thanks Matt
Alex Abdo
872 PointsI went with changing the textColor and background properties in the button itself instead of using a separate style, but thank you for the tip!
Ricky Sparks
22,249 PointsThanks just googled this and it worked :)
Matthew Schmitt
12,234 PointsMatthew Schmitt
12,234 PointsThat worked. Thanks!
Alex Abdo
872 PointsAlex Abdo
872 PointsThat fixed the button background and following Matheus's lead, I changed the text color within the button's properties. Thank you!