PickerView是什么
仿ios的PickerView控件,带有3D圆弧效果,并封装了时间选择和选项选择这两种选择器。
效果:
导包
compile 'com.contrarywind:Android-PickerView:4.1.9'
用法:
XM中的布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.contrarywind.view.WheelView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/wv"
></com.contrarywind.view.WheelView>
</LinearLayout>
Activity代码:
package com.example.day011;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.bigkoo.pickerview.adapter.ArrayWheelAdapter;
import com