一:在values里新建一個resource file:
二:在自定義view中通過 context.obtainStyledAttributes(attrs, R.styleable.attrSample) 方法獲取漂佩。
TypedArray ta=context.obtainStyledAttributes(attrs, R.styleable.attrSample) ;
三:在xml布局中使用該View运怖,因為使用到自定義的參數(shù)掘而,因此會在布局根目錄進行引用:
xmlns:app