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);