首页 > 代码库 > TextView 常用摘要

TextView 常用摘要

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