1、代码中设置drawableTop
TextView textView = new TextView(getActivity()); Drawable drawable = getResources().getDrawable(R.drawable.home_1); drawable.setBounds(0, 0, drawable.getMinimumWidth(),drawable.getMinimumHeight()); textView.setCompoundDrawables(null, drawable, null, null); textView.setCompoundDrawablePadding(10);//设置drawablepadding
原文地址:http://www.cnblogs.com/cll-android/p/3833047.html