1

I placed a spinner on a dialog. When I want to select an item and the item list is shown below the spinner, everything is fine and I can scroll through the items. But if the item list is shown above the spinner, the item list is cut off and I cannot scroll:

Item list is cut off

It looks like the system does not identify, that the item list above the dialog is not visible and therefore does not show the scrollbars.

My spinner definition looks like this:

            <Spinner
            android:id="@+id/spnnrValue"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_marginTop="2dp"
            android:layout_marginLeft="-20dp"
            android:layout_weight="1" />

This is how I define the dialog:

        dialogColorPickerExtended = new Dialog(Base.getMainActivity(), R.style.full_screen_dialog);
    dialogColorPickerExtended.setCancelable(true);
    dialogColorPickerExtended.setContentView(R.layout.template_color_picker_extended);
    if (dialogColorPickerExtended.getWindow() != null)
        dialogColorPickerExtended.getWindow().getAttributes().width = (int) (GUIManager.getScreenWidth() * 0.9f);

Do you have any idea, how I can show the complete item list?

1 Answers1

0

You might not be able to show it all at once, but adding a scrollbar to the spinner itself may be a solution. Visit this page, you might be able to solve this problem with an overall functionality improvement by adding a scrollbar to your spinner.

Spinner's scrollbar style

Krausladen
  • 138
  • 10