Android 省市区三级连动--spinner.rar
2022-07-05 18:07:26 181KB Android
Android Spinner图文混排源码.rar
2022-07-04 18:06:49 167KB Android
Android Spinner图文混排源码.zip
2022-06-14 16:04:04 85KB 源码
在开发中遇到下拉框需要多选时,自定义一个Spinner控件。
2022-05-31 14:12:49 25KB 下拉框,多选
1
Spinner下拉菜单多选,在布局xml文件直接作为控件使用,在activity里面调用就行了
2022-05-21 10:14:22 7KB MultiSpinner
1
根据本讲学习内容,学会应用HttpURLConnection、JSON数据解析以及联动Spinner实现简单天气查询。 (1) 提交的作业包中含有应用程序运行效果截图。
2022-05-16 19:43:25 8.09MB android HttpURLConnectio JSON Spinner
1
支持输入筛选的类spinner实现(AndroidStudio源码)支持拼音(首字母)搜索
2022-05-06 09:06:01 236KB 源码软件
1
我是一个android新手,所以一切以简单起步。android的控件spinner,类似于一个下拉列表.如果您正在学习这个控件,需要实现基于这个控件的二级联动效果,不妨使用这个看看. 使用方法:用eclipse导入,假若报错,把平台改为android2.2,jdk1.6就可以了。
2022-05-05 12:15:51 44KB android spinner 省市二级联动 源码
1
spProvince = (Spinner)findViewById(R.id.spAddMettingAddressProvince); spCity = (Spinner)findViewById(R.id.spAddMettingAddressCity); ArrayAdapter aAdapter = ArrayAdapter.createFromResource(this, R.array.province, android.R.layout.simple_spinner_item); aAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spProvince.setAdapter(aAdapter); spProvince.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { Spinner spinner = (Spinner)parent; String pro = (String)spinner.getItemAtPosition(position); ArrayAdapter cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.city_default, android.R.layout.simple_spinner_item); //new ArrayAdapter // (MainActivity.this,android.R.layout.simple_spinner_item, cities); //获取所在省含有哪些市(从资源数组文件中获取数据) if(pro.equals("河北省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hebei, android.R.layout.simple_spinner_item); }else if(pro.equals("北京市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.bj, android.R.layout.simple_spinner_item); }else if(pro.equals("山西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shan1xi, android.R.layout.simple_spinner_item); }else if(pro.equals("天津市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.tianjing, android.R.layout.simple_spinner_item); }else if(pro.equals("内蒙古")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.neimeng, android.R.layout.simple_spinner_item); }else if(pro.equals("辽宁省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.liaoning, android.R.layout.simple_spinner_item); }else if(pro.equals("吉林省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jilin, android.R.layout.simple_spinner_item); }else if(pro.equals("黑龙江省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.heilongjjiang, android.R.layout.simple_spinner_item); }else if(pro.equals("上海市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shanghai, android.R.layout.simple_spinner_item); }else if(pro.equals("江苏省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jiangsu, android.R.layout.simple_spinner_item); }else if(pro.equals("浙江省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.zhejiang, android.R.layout.simple_spinner_item); }else if(pro.equals("安徽省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.anhui, android.R.layout.simple_spinner_item); }else if(pro.equals("福建省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.fujian, android.R.layout.simple_spinner_item); }else if(pro.equals("江西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.jiangxi, android.R.layout.simple_spinner_item); }else if(pro.equals("山东省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shandong, android.R.layout.simple_spinner_item); }else if(pro.equals("河南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.henan, android.R.layout.simple_spinner_item); }else if(pro.equals("湖北省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hubei, android.R.layout.simple_spinner_item); }else if(pro.equals("湖南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hunan, android.R.layout.simple_spinner_item); }else if(pro.equals("广东省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guangdong, android.R.layout.simple_spinner_item); }else if(pro.equals("广西自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guangxi, android.R.layout.simple_spinner_item); }else if(pro.equals("海南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.hainan, android.R.layout.simple_spinner_item); }else if(pro.equals("重庆市")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.chongqing, android.R.layout.simple_spinner_item); }else if(pro.equals("四川省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.sichuan, android.R.layout.simple_spinner_item); }else if(pro.equals("贵州省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.guzhou, android.R.layout.simple_spinner_item); }else if(pro.equals("云南省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.yunan, android.R.layout.simple_spinner_item); }else if(pro.equals("西藏自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xizang, android.R.layout.simple_spinner_item); }else if(pro.equals("陕西省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.shan3xi, android.R.layout.simple_spinner_item); }else if(pro.equals("甘肃省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.gansu, android.R.layout.simple_spinner_item); }else if(pro.equals("青海省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.qinghai, android.R.layout.simple_spinner_item); }else if(pro.equals("宁夏回族自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.ningxia, android.R.layout.simple_spinner_item); }else if(pro.equals("新疆维吾尔自治区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xinjiang, android.R.layout.simple_spinner_item); }else if(pro.equals("香港特别行政区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.xianggang, android.R.layout.simple_spinner_item); }else if(pro.equals("澳门特别行政区")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.aomen, android.R.layout.simple_spinner_item); }else if(pro.equals("台湾省")){ cityAdapter = ArrayAdapter.createFromResource (MettingAddActivity.this, R.array.taiwan, android.R.layout.simple_spinner_item); } cityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //绑定数据到Spinner(City)上 spCity.setAdapter(cityAdapter); } @Override public void onNothingSelected(AdapterView parent) { } });
2022-05-05 11:15:21 14KB android spinner 省市二级联动
1
NULL 博文链接:https://txlong-onz.iteye.com/blog/826553
2022-03-26 17:32:44 46KB 源码 工具
1