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

Android Build a Simple Android App (2014) Creating the Screen Layout Setting Colors

Dan Someone
Dan Someone
1,320 Points

My button has all caps in the text, but the video has varying capitals with just the first letter. Is that an option?

I typed "Show Another Fun Fact" in my button text, but it is showing "SHOW ANOTHER FUN FACT" on the button text. I converted it to a string ID and checked the string file as well, it has the proper case value, but it is not displaying correctly.

3 Answers

Harry James
Harry James
14,780 Points

Hey Dan!

The latest versions of the Android SDK have capitalisation enabled by default for buttons.

If you go ahead and add this line of code to your XML file, it should remove the capitalisation for you:

<item name="textAllCaps">false</item>

Hope it helps and if you have any more questions, give me a shout :)

Could you be a bit more specific? I'm not sure where to add this item, when I add it to my activity xml file, right before "/RelativeLayout>" I get an error, and the Fun Facts app won't run.

Android Studio automatically changes the text to: <item name="textAllCaps" android:layout_width="wrap_content" android:layout_height="wrap_content">false</item>

I'm not sure where to put it.

Just add this line between your button tag: android:textAllCaps="false"

 <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Show Another Fun Fact"
        android:id="@+id/showFactButton"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:singleLine="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentLeft="true"
        android:background="#ffffff"
       android:textAllCaps="false"
        />
Harry James
Harry James
14,780 Points

Hey Palfalvi Laszlo Lorand!

Thanks for that explanation there! I must've missed Liv Levi's reply before!

Appreciate the help :)

I appreciate your service here and everyone who made all this possible for those who want to learn. Thank you TeamTreehouse!