Reputation: 1056
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.
Upvotes: 8
Views: 6875
Reputation: 161
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
you could try the above in your program to get fullscreen spinner :)
Upvotes: 0
Reputation: 418
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
Upvotes: 13