# Picker **Repository Path**: zzuli/Picker ## Basic Information - **Project Name**: Picker - **Description**: 城市选择 - **Primary Language**: Unknown - **License**: Artistic-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-04-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #picker 选择器,可以选择时间,日期 ![image](http://git.oschina.net/zzuli/city_picker/raw/master/img/city.jpg) ![image](http://git.oschina.net/zzuli/city_picker/raw/master/img/date.jpg) #如何使用 gralde 使用 compile 'haitao.library.picker:lib:0.0.2' ```java // 显示城市 new AlertCityPicker.Builder(MainActivity.this) .setOnItemClickListener(new AlertCityPicker.OnItemClickListener() { @Override public void endSelect(CityResult _cityResult,boolean isCancel) { cityResult=_cityResult; Toast.makeText(getApplicationContext() ,cityResult.getProviceName()+"-"+cityResult.getCityName()+"-"+cityResult.getRegionName()+isCancel ,Toast.LENGTH_SHORT).show(); } }). setTitle("城市"). // 不设置 则没有标题 setCancelable(false). show(); // 显示日期 new AlertDatePicker.Builder(MainActivity.this) .setOnItemClickListener(new AlertDatePicker.OnItemClickListener() { @Override public void endSelect(Date selectDate, String selectDateStr, boolean isCancel) { Toast.makeText(getApplicationContext() ,selectDateStr+isCancel ,Toast.LENGTH_SHORT).show(); } }). setTitle("时间"). // 不设置 则没有标题 setCancelable(false). // setDate().可设置开始结束时间 show();