mercredi 13 mai 2015

How to add a widget only for design time

Inspired by the tools attributes which allow to override layout properties when using the UI designer in Eclipse/Android Studio but without any effect on the running application I would like to have entire widgets stripped away:

I have a LinearLayout which is populated with several children at runtime. To visualize this in the UI editor, I added two dummy views to the layout xml which are then deleted using removeAllViews at runtime. This means that the dummy views are needlessly generated just to be removed shortly after.

Is there a way to define the views as dummies using something similar to the "tools"-attribute?

Aucun commentaire:

Enregistrer un commentaire