前言
一个简单的小控件的使用,代码简单,使用方便
效果图
代码示例
layout/number_adder.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:id="@+id/btn_reduce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/reduce"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_count"
android:layout_width="50dp"
android:layout_height="40dp"
android:gravity="center"
android:text="1"
android:textColor=&