Skip to content
New issue

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

MaterialSpinner Hint #150

Open
keitheyre opened this issue Jul 8, 2021 · 1 comment
Open

MaterialSpinner Hint #150

keitheyre opened this issue Jul 8, 2021 · 1 comment

Comments

@keitheyre
Copy link

Seems to be no way to set a Hint. This would be useful for initialising the items dropdown with a pre-defined String i.e. "Please Select" or "Choose one"

@RikySaepuloh
Copy link

You can set a Hint. You need to set items into the MaterialSpinner first. This is how it works.

YourActivity.kt

// Your Code

materialSpinner.setItems(arrayListOf("Option 1","Option 2","Option 3"))

_// Rest of Your Code_

YourLayout.xml

<com.jaredrummler.materialspinner.MaterialSpinner
                android:id="@+id/material_spinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:ms_hint="Your Hint"/>  <!--     Insert your hint       -->

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants