NiceSpinner 完美的 Android 下拉选择框

1.简介

GitHub地址:https://github.com/arcadefire/nice-spinner

 

Gradle中添加:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

dependencies {
    implementation 'com.github.arcadefire:nice-spinner:1.3.7'
}

  

 

 

 

2.使用

 

xml文件:

    <org.angmarch.views.NiceSpinner
        android:id="@+id/nice_spinner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        app:arrowTint="@color/colorPrimary"
        app:textTint="#f00"
        />

  

activity:

        spinner=findViewById(R.id.nice_spinner);
        List<String> dataset = new LinkedList<>(Arrays.asList("One", "Two", "Three", "Four", "Five"));
        spinner.attachDataSource(dataset);

  

 

posted @ 2019-01-08 14:02  段合江  阅读(3901)  评论(0编辑  收藏  举报