Placeholder text (design process only) in Android layout?

AndroidAndroid LayoutAndroid StudioPlaceholder

Android Problem Overview


Is it possible to create placeholder text that is only visible during the layout design process in Android Studio?

For example, say I have 2 TextViews in a linear layout that are going to be dynamically populated. During the design phase, I use placeholder text to ensure I get padding and such correct. I often forget to remove placeholder text, so during loading of the new data, the old data will appear for a split second... looks tacky.

It would be cool if there was a field similar to android:placeholderText="This is placeholder text" that would only display in the preview. There isn't such a thing that I've happened to have missed is there?

Android Solutions


Solution 1 - Android

Yes it is (these days), and I believe that this is probably what you're looking for:
https://developer.android.com/studio/write/tool-attributes - specifically: tools:text=""

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionloeschgView Question on Stackoverflow
Solution 1 - AndroidfantasitcalbeastView Answer on Stackoverflow