Android spinner full screen view
Asked Answered
C

2

8

I have a form in a DialogFragment that includes a spinner. I don't think I can port the spinner options out to a new activity (e.g. customisable ListView etc.) as it will close the DialogFragment, so I'm using the spinner embedded into the DialogFragment (screenshot 1). There is nothing unusual about how I'm populating the spinner with an ArrayList and adapter.

<Spinner
    android:id="@+id/breedingcodes"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="10dip" />

Functionally it works fine and the spinner options appear and are selectable, but looks terrible as it only uses half the screen (see screenshot 2), anchored to the position of the spinner in the DialogFragment. Is there anyway to force it to use the full screen, as in the 3rd screenshot with Breeding evidence title? I've tried fiddling with layout_height="match_parent" etc. - no joy.

App is developed for min SDK_10, compiled for SDK_23, build tools 23.0.3.

Form in DialogFragment Sub-standard spinner view Full screen spinner view

Cuticle answered 5/7, 2016 at 9:53 Comment(0)
G
13

You can either create your own dialog and style it as you want, or just use

android:spinnerMode="dialog"

as attribute in spinner. See docs here

Genista answered 5/7, 2016 at 10:17 Comment(0)
O
0
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

you could try the above in your program to get fullscreen spinner :)

Oldham answered 5/7, 2016 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.