一、新建属性
在新建的module中的values文件夹下新建atts.xml
声明
<declare-styleable name="Topbar">
<attr name="title" format="string"/>
//此处省略10000字
</declare-styleable>
二、实现自己的View
可以继承RelativeLayout
创建构造方法
private String title;
private TextView mTvTitle;
private LayoutParams