Textview设置图片位置: 左上右下
eg:
调用方法:public void setCompoundDrawables(@Nullable Drawable left, @Nullable Drawable top, @Nullable Drawable right, @Nullable Drawable bottom) 参数说明:四个参数分别位于TextView 左上右下四个方位 |
代码实际应用://获取本地图片Drawable top = mContext.getResources().getDrawable(R.mipmap.conversion_arrows_up);
top.setBounds(0, 0, top.getMinimumWidth(), top.getMinimumHeight());
//设置图片显示位置
mTextview.setCompoundDrawables(null, null, top, null); |