Hello, I'm trying to make a spinner with the options: "Open Today" and "It Does not Matter."
In my layout, I do not want anything written but a clock icon, which when clicked loads the spinner list.
I put the image in the background of the spinner.
It happens that it expands as the list option is selected, can you leave it as a fixed size?
And also the other question is will be that the list with the options can be added only in position 1, because as I do not know this, I'm adding the first element of the list as "" so that the layout is only the image. / p>
I tried to put it as a listheader, but it did not work. Thank you! What I'm using:
No Layout:
<Spinner
android:id="@+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:scrollIndicators="end"
android:textAlignment="center"
android:background="@drawable/local" />
No código:
horario = new ArrayList<>();
horario.add("");
horario.add("Aberto Hoje");
horario.add("Não importa");
adapter = new ArrayAdapter<String>(getApplication(), android.R.layout.simple_spinner_dropdown_item, horario);
spinnerhora.setAdapter(adapter);