Androind custom spinner doesn't show the dropdown arrow
http://www.coderzheaven.com/2011/07/18/customizing-a-spinner-in-android/
In this example before an item is selected it shows text and dropdown
arrow on the right. When they user clicks it (displaymode = dropdown?) it
shows the prompt with an arrow.
I do not have android theme on my app. I have custom spinner like so:
List<LanguageSelection> nativeLanguagesData =
getSupportedLanguageList();
LanguageSelectionListAdapter nativeAdapter = new
LanguageSelectionListAdapter (this,
R.layout.fragment_language_selection, nativeLanguagesData);
nativeAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
Spinner uxNativeLanguageSpinner =
(Spinner)findViewById(R.id.uxNativeLanguageSpinner);
uxNativeLanguageSpinner.setAdapter(nativeAdapter);
and for xml:
<Spinner android:id="@+id/uxNativeLanguageSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:padding="0dp"
android:spinnerMode="dropdown"
android:prompt="@string/status_prompt"
android:layout_below="@id/uxNativeLanguageSelectLabel"
android:popupBackground="@android:color/transparent" />
Attached is what actually appears. I've scoured the internet tryinig to
figure out why this thing doesn't show. I also have the android
simple_spinner_dropdown_item.xml in my code base instead of referencing
andorid.*. Any ideas? I'd like to get rid of my ugly label just above the
spinner indicating the user needs to select something and instead use the
common dropdown arrow. Just doesn't show when I create a custom spinner
though. Again, the items in the list appear correctly it's just that i
want the first item be something like in the link at the top where there
is Select and iten and icon to the right indicating it's dropdown.
//image removed as "i need at least 10 reputation points to post image".
Basically my spinner is custom spiiner with text on left and image on
right for each item in the list.
No comments:
Post a Comment