一.自定义视图属性
写一个创建长方形的View
1.创建一个MyRect.java继承自View来完成,在对应的xml文件中调用这个View,并在value里创建一个xml文件来描述自定义的属性。
创建的attr.xml内容如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="MyView">
<attr name="rect_color" format="color"/>
</declare-styleable>
</resources>
在对应的xml文件中调用这个View
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:jkxy="http://sche