0

In my application I want use Spinner and for this a use this library : MaterialSpinner

How can I add android:prompt to this library?

please help me, I need this help

1 Answers1

0

Can take a Look at this library:

Material Spinner

Use this dependency in your build.gradle file to reference this library in your project

compile 'com.github.ganfra:material-spinner:1.1.1'

In the xml :

<fr.ganfra.materialspinner.MaterialSpinner
        android:id="@+id/spinner"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        app:ms_multiline="false"
        app:ms_dropDownHintView="@layout/my_custom_dropdown_hint_item_layout"
        app:ms_hintView="@layout/my_custom_hint_item_layout""
        app:ms_hint="hint"       
        app:ms_enableFloatingLabel="false"
        app:ms_enableErrorLabel="false"
        app:ms_floatingLabelText="floating label"
        app:ms_baseColor="@color/base"
        app:ms_highlightColor="@color/highlight"
        app:ms_errorColor="@color/error"
        app:ms_typeface="typeface.ttf"
        app:ms_thickness="2dp"
        app:ms_hintColor="@color/hint"
        app:ms_arrowColor="@color/arrow"
        app:ms_arrowSize="16dp"
        app:ms_alignLabels="false"
        app:ms_floatingLabelColor="@color/floating_label"/>

You can set a hint and a floating label text. If no floating label text is provided, the hint will be set instead.

rafsanahmad007
  • 23,683
  • 6
  • 47
  • 62
  • Thanks my friend, in my application I get data from server in List<>. such as this `response.body().getData()` in retrofit. but in your library I should add string[] for items. how can I convert i list to string[] ? please help me –  Jun 23 '17 at 09:37
  • check this: https://stackoverflow.com/questions/5374311/convert-arrayliststring-to-string-array – rafsanahmad007 Jun 23 '17 at 09:49