您的位置:首页 > 编程语言

代码设置TextView的drawableLeft

2016-03-03 00:00 274 查看
摘要: 代码设置TextView的drawableLeft

Drawable drawable = ContextCompat.getDrawable(mContext, R.drawable.publish_dynamic_entry);
int size = (int) SizeUtils.dp2Px(getResources(), 24.0f);

// 这一步必须要做,否则不会显示.

drawable.setBounds(0, 0, size, size);
mPublishTv.setCompoundDrawables(drawable, null, null, null);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: