Created
January 24, 2014 09:31
-
-
Save facebookegypt/8594489 to your computer and use it in GitHub Desktop.
@string resource solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- example: XML file saved at res/values/strings.xml: --> | |
<!-- Android Development Solution --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="yellow">Yellow</string> | |
</resources> | |
This layout XML applies a string to a View: | |
<TextView android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:text="@string/yellow" /> | |
Similarly colors should be stored in colors.xml and then referenced by using @color/color_name | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="Black">#000000</color> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment