Git Product home page Git Product logo

cascade_master's Introduction

省市区三级联动的选择控件, 整体效果如下:

mahua

##基本结构

UI:自定义控件WheelView

数据:基于XML的数据解析

适配器:建立通用的Adapter,供给自定义的控件使用

##实现思路

本Demo提供了一份较为完整的,国内所有省市区的三级数据。

具体见project的代码,Assets目录下的province_data.xml文件。

您也可以自己定制数据格式,配置xml和对应的解析代码。

常见的XML解析器分别为DOM解析器、SAX解析器和PULL解析器,。

本Demo中使用的是XML的SAX解析方式,因为其解析速度快和占用内存小的优势。

解析代码见initProvinceDatas()方法,

##有问题反馈 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.