android-layoutandroid-viewadtplaceholder

Can the graphical layout editor show placeholder images and text?


When adding TextViews and ImageViews to my layouts that will be populated dynamically at runtime, I often add placeholder text and images so I can preview a realistic layout. Can the layout editor do this for me without requiring me to explicitly include these strings and images in my application automatically?


Solution

  • It doesn't look like this feature exists, so I created a feature request.

    When adding TextViews and ImageViews to my layouts that will be populated dynamically at runtime, I often add placeholder text and images so I can preview a realistic layout.

    Please enable the layout editor do this for me without requiring me to explicitly include these strings and images in my application automatically. I assume you'd want to have a default image size in the preferences and allow individual ImageViews/texts to override the defaults with something like tools:defaultImageWidth=123px, tools:defaultText="Lorem Ipsum", etc.

    tools:numDefaultLoremIpsumTextChars=80 would generate 80 characters of default text.