自定義類(主要代碼)app
happyView LinearLayout { ImageView ; TextView ; happyView(Context context, AttributeSet attrs) { (context, attrs); View view = LayoutInflater.(context).inflate(R.layout., ,); = (ImageView) view.findViewById(R.id.); = (TextView) view.findViewById(R.id.); .setImageResource(R.mipmap.); .setText(); }
這裏能夠動態設置圖片和文字佈局
自定義佈局的引用就不說了code