I have a spinner with its mode set to dialog:
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner1"
android:spinnerMode="dialog"
android:dropDownWidth="match_parent"
android:textAppearance="@style/TextAppearance.Medium"
android:prompt="@string/label_selection" />
How can I a Cancel button to its dialog?
The only way is to create your own custom spinner, like:
Important things need to be implemented:
protected onDraw()- which would actually draw yourMySpinner+ buttonprotected void onMeasure(int widthSpec, int heightSpec)- defines size of your custom spinnerHere's a link to tutorial which covers basics of custom widgets