本人新手,刚学android。记录下一些容易忘记的东西,都是自己瞎琢磨理解的,不一定正确,往高手指正,同时,不建议其他新手参考(容易被带到沟里,慎看)
这是第一个博文,制作一个button。
1、先看怎么用它,将它放在布局文件中。
在main.xml中的某个位置:
<com.lei.widget.DimPanelBottomBar
android:id="@+id/btn_bootom_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8.0dip"
custom:left_text="@string/cancel"
custom:left_text_color="@color/button_cancel_color"
custom:right_text="@string/confirm"
custom:right_text_color="@color/button_confirm_color" />
好了,我们可以看到它有几个属性是以custom开头的,它们是这个控件特有的东西,是我自定义添加进去的属性。好了,我们去valuse/attrs中定义这些特有的属性(show_my_style属性是多余定义的,暂时没有用到,不用理会)
<declare-styleable name="CusSetMonitorDistanceBar">
<attr name="leftText" format="string" />
<attr name="leftTextColor" format="string" />
<attr name=