如今在现在日常开发中已经很少会用到ImageButton这个控件,它本身没有带text属性,简直Low的不得了,一般人们选择用组合控件实现这个功能,所以必须自定义实现,这样的做法可以提高布局优化,对性能还是有所提高的,很简单,只需要你们用一分钟的时间来copy下面代码
ImageB.java
public class ImageB extends LinearLayout {
private ImageView imageView;
private TextView textView;
public ImageB(Context context) {
super(context);
}
public ImageB(Context context, AttributeSet attrs) {
super(context