compile 'com.contrarywind:Android-PickerView:3.2.5'
private ArrayList<String> provinceArrary = new ArrayList<>();//省份的List
private ArrayList<ArrayList<String>> cityArrary = new ArrayList<>();//城市的二维List
private OptionsPickerView mProvinceCityDialog = null;
private void InitlaceDialog() {
mProvinceCityDialog = new OptionsPickerView.Builder(this, new OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
tProvinceCode = ProvinceAndCitylist.get(options1).getId();
tCityCode = ProvinceAndCitylist.get(options1).getCitys().get(options2).getId();
reqUpdatePlace(tProvinceCode,tCityCode);
}
})
.setTitleText("城市选择")
.setContentTextSize(20)//设置滚轮文字大小
.setDividerColor(Color.TRANSPARENT)//设置分割线的颜色
.setSelectOptions(0, 1)//默认选中项
.setBgColor(Color.WHITE)
.setTitleBgColor(Color.WHITE)
.setTitleColor(Color.LTGRAY)
.setCancelColor(Color.BLACK)
.setSubmitColor(Color.BLACK)
.setTextColorCenter(Color.BLACK)
.isCenterLabel(false) //是否只显示中间选中项的label