LayoutのGUIエディタを用いて、Layoutを作成しています。
例えば、TextViewの中身が動的に変わる場合、私は、今は空文字列に設定しています。
動的に変わる処理が走るまではユーザーには空文字列として見せたいからです。
しかし、GUIエディタ上では、空文字列だと何かと作りにくいです。
そこで、GUIエディタ上でのみ表示されるダミーテキスト(テキストに限らないですが)を指定する方法などがあれば知りたいです。
スタック・オーバーフローはプログラマーとプログラミングに熱心な人のためのQ&Aサイトです。すぐ登録できます。
登録してこのコミュニティに参加するtools 名前空間というのがありまして。
Designtime Layout Attributes - Android Tools Project Site
レイアウト XML のルート要素に xmlns:tools="http://schemas.android.com/tools" を追加して、あとは個々の要素で android の代わりに tools を接頭辞に用いた属性を記入していきます。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Dummy Text" />
</LinearLayout>