zoukankan      html  css  js  c++  java
  • 下拉框spinner

    repositories {
    flatDir {
    dirs 'libs' //就是你放aar的目录地址
    maven { url "https://jitpack.io" }
    }
    }
    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    compile 'com.github.arcadefire:nice-spinner:1.3.1'
    }

    xml中
    <org.angmarch.views.NiceSpinner

    android:id="@+id/spinner1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:layout_marginRight="1dp"/>

    spinner1.attachDataSource(list1_yuzhong);
    spinner1.addOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    String name = list1_yuzhong.get(position).toString();//点击的条目



     
  • 相关阅读:
    AOP概述
    AOP-动态代理
    IOC容器和Bean的配置
    Spring框架概述
    异常
    Optional 类
    Stream API
    方法引用(Method References)
    函数式(Functional)接口
    stm8笔记1-搭建工程+孤独的小灯闪烁
  • 原文地址:https://www.cnblogs.com/leshen/p/9098658.html
Copyright © 2011-2022 走看看