Last active
November 2, 2015 07:04
-
-
Save riggaroo/fd3199c043e02e399b5c to your computer and use it in GitHub Desktop.
Example usage of the tools namespace for creating a meaningful Design View
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
<TextView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:visibility="gone" | |
tools:visibility="visible" | |
tools:text="Rebecca Franks" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tired of creating dummy text strings in the strings.xml file? or want to see things in the Design View but its supposed to be hidden?
You can use the nifty tools namespace to make things visible for design purposes but have no affect in your app. Add the tools namespace to your XML file, and you can override things such as visibility and text.
Even though android:visibility is set to gone, using tools:visibility to visible, the view will be visible in the Design View but not in the real implementation. Very handy for complex layouts.