textview动态设置 DrableLeft 以及改变图片大小
来源:互联网 发布:51游戏java官网 编辑:程序博客网 时间:2024/06/05 10:10
if (i_count==0){ Drawable drawable1= getResources().getDrawable(R.drawable.ic_news_comment_write);/// 这一步必须要做,否则不会显示. drawable1.setBounds(0, 0, 30, 30); tvComment.setCompoundDrawables(drawable1,null,null,null);// tvComment.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_news_comment_write,0,0,0); tvComment.setText("写评论"); }else { Drawable drawable2= getResources().getDrawable(R.drawable.ic_comment_top);/// 这一步必须要做,否则不会显示. drawable2.setBounds(0, 0, drawable2.getMinimumWidth(), drawable2.getMinimumHeight()); tvComment.setCompoundDrawables(drawable2,null,null,null); tvComment.setText(" "+count + " 评论"); } tvComment.setVisibility(isLoaded ? View.VISIBLE : View.GONE);}
根据评论数:
drawable1.setBounds(0, 0, 30, 30); 控制图片大小第一0是距左边距离,第二0是距上边距离,30分别是长宽
0 0
- textview动态设置 DrableLeft 以及改变图片大小
- textview设置图片大小
- textView 设置图片大小
- transform改变图片大小以及位置
- 动态设置Button图片大小
- Java script 动态改变 图片大小
- iOS textview加载html并改变图片大小
- TextView动态改变颜色
- drawleft,textview、EditText中图片大小设置
- 自定义TextView实现设置drawable图片大小
- 动态设置drawableTop中图片大小
- drawableTop怎样动态设置图片大小
- 在网页中动态改变图片大小
- RadioButton动态改变drawableTop的图片大小
- 通过代码设置改变radiobutton图片大小
- TextView 控件设置以及动态给布局添加控件
- 动态设置TextView的对齐方式以及getLineCount的使用
- Android 动态改变TextView字体大小
- SSH 部分jar包的作用
- 自定义控件其实很简单1/2
- Ubuntu下resize图片以及查看大小命令
- 【编程素质】关于equals引发的null object reference异常
- Codeforces Round #363 (Div. 2) B. One Bomb(思维题目)
- textview动态设置 DrableLeft 以及改变图片大小
- ThinkPHP使用详解
- STM32F1学习-SysTick定时器
- C语言描述数据结构———封装DLL
- 数据库常用操作
- 《项目策划》助学站,技术助学站,安卓助学站
- 编译Android:make: *** [out/target/common/obj/APPS/Phone_intermediates/classes-full-debug.jar] error 41
- android:padding和android:margin的区别
- 内存泄漏之内部类handler()