TextView 文字加图片显示效果

来源:互联网 发布:ug8车削加工编程教学 编辑:程序博客网 时间:2024/05/07 09:40

TextView中经常出文本加图片的显示效果:

android:drawableLeft=""android:drawableRight=""android:drawableTop=""android:drawableBottom=""//图片相对于文本的位置
android:drawablePadding=""//图片与文字间距
//代码中设置textView中的图片,图片显示的位置,图片要显示那个位置,就把图片放在那个位置//int left, int top, int right, int bottomtextView.setCompoundDrawablesWithIntrinsicBounds(                    R.drawable.dynamic_praise, 0, 0, 0);
0 0
原创粉丝点击