Search code examples
androidgraphical-layout-editor

Custom text for spinner preview in Android graphical layout editor


By default if I create a Spinner in the graphical layout editor (using the Spinner Item preview layout, i.e android.R.layout.simple_spinner_item) the displayed text is

Item 1

Is there any way to change this preview text ?


Solution

  • Views have a function called "isEditMode()" that can be used to change the way items look in the Graphical Editor. This SO might help you out:

    Custom Android Views in Eclipse Visual Editor