现在res/values中定义一个attrs.xml,设置view属性
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="AddDeleteViewStyle">
<attr name="left_text" format="string"></attr>
<attr name="right_text" format="string"></attr>
<attr name="middle_text" format="string"></attr>
<attr name="left_text_color" format="color"></attr>
</declare-styleable>
</resources>
控件布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_