In particular, to preview the spinner, use tools:listitem along with the layout:
<Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:listitem="@android:layout/simple_list_item_1" />
You can also set this preview in the visual editor by right-clicking on the Spinner and selecting "Preview layout spinner". In any case, it should be a specific layout, not a simple text string.
Thus, it is recommended that you install fictitious texts in a specific layout of the list item that you will use anyway (for example, in your Adapter in Java code), and then directly view this layout, as described above.
source share