GithubHelp home page GithubHelp logo

customviewautotypeanalysis's Introduction

#实例化自定义控件属性方法 ###实现复杂自定义Android控件经常出现十几个甚至几十个控件属性,这样就要写相当多的typedArray.getXXX()方法去获取各个属性值 本Library 采用注解方式获取控件属性,类似大家平时用注解findViewById

使用方法

// 声明属性 实用注解
@TypeAnno(R.styleable.MyGraView_rv_drawable)
private String myDrawalbe;
// 获取TypedArray并传入TypeAnalysis中		
TypedArray typedArray = mContext.obtainStyledAttributes(attributes, R.styleable.MyGraView);
//这里的this就是当前的自定义控件了
TypeAnalysis.getTypes(this, typedArray);
    

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.