12.8工作日志

来源:互联网 发布:ajax eval json 编辑:程序博客网 时间:2024/05/16 01:47

1.导入GitHub项目

将项目文件解压后粘贴到你的项目文件夹根目录


2.Clean Project

3.在gradle Setting里添加


3.在Gradle App里添加


4.rebuild Project

5.在项目中使用

<LinearLayout    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:orientation="horizontal"    android:gravity="center_vertical"    android:background="@drawable/corners_bg"    android:padding="1dp"    android:layout_marginTop="@dimen/padding_normal">    <ImageView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:src="@mipmap/new_register_school"        android:contentDescription="@string/A_Picture"        android:layout_marginLeft="10dp"/>    <org.angmarch.views.NiceSpinner        android:id="@+id/profession"        android:layout_width="0dp"        android:hint="职业"        android:layout_weight="1"        android:background="@drawable/corners_bg"        android:layout_height="wrap_content"        android:layout_marginLeft="2dp"        android:singleLine="true"        android:maxLength="50"        android:paddingLeft="@dimen/padding_item"        /></LinearLayout>
 final List<String> eduDataset = new LinkedList<>            (Arrays.asList(                    "海归", "博士后", "博士", "硕士", "本科", "高中","初中", "初中及以下","其他"            ));    edu_txt.attachDataSource(eduDataset);    edu_txt.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {            if (position!=0)            edu_txt.setText(eduDataset.get(position));        }        @Override        public void onNothingSelected(AdapterView<?> parent) {            edu_txt.setText("请选择教育背景");        }    });}
NiceSpinner niceSpinner = (NiceSpinner) findViewById(R.id.nice_spinner);

0 0
原创粉丝点击