We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
you need download code and change two file
1.change MaterialSpinner.java first change init:
private int selectedIndex = -1;
////second change setAdapterInternal :
private void setAdapterInternal(@NonNull MaterialSpinnerBaseAdapter adapter) { boolean shouldResetPopupHeight = listView.getAdapter() != null; adapter.setHintEnabled(!TextUtils.isEmpty(hintText)); listView.setAdapter(adapter); if (selectedIndex >= adapter.getCount()) { selectedIndex = 0; } if (adapter.getItems().size() > 0 && selectedIndex >= 0) { if (nothingSelected && !TextUtils.isEmpty(hintText)) { setText(hintText); setHintColor(hintColor); } else { setTextColor(textColor); setText(adapter.get(selectedIndex).toString()); } } else { String text = "please select"; if(!TextUtils.isEmpty(hintText)){ text = hintText; } setText(text); } if (shouldResetPopupHeight) { popupWindow.setHeight(calculatePopupWindowHeight()); } }
<xxxxxx.MaterialSpinner android:id="@+id/spinner" android:layout_width="match_parent" android:layout_height="44dp" android:layout_marginLeft="20dp" android:layout_marginRight="10dp" android:elevation="1dp" app:ms_hint="custom hint text" android:textColor="#D9000000" />
now success!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
you need download code and change two file
1.change MaterialSpinner.java
first change init:
now success!
The text was updated successfully, but these errors were encountered: