【TabHost】Android设置TabHost文字及图片
16lz
2021-01-23
Android TabHost 文字及图片的设置
TabWidget tabWidget=myTabhost.getTabWidget();//设置字体颜色
for(int i=0;i<tabWidget.getChildCount();i++){
//设置显示文字
TextView tv=(TextView)tabWidget.getChildAt(i).findViewById(android.R.id.title);
//设置显示图片 ImageView iv=(ImageView)tabWidget.getChildAt(i).findViewById(android.R.id.icon);
iv.setPadding(0, 10, 0, 0);
tv.setPadding(0, -5, 0, 0);
tv.setTextColor(Color.BLACK);
}
更多相关文章
- android下载网络图片并缓存
- Android实现textview文字滚动显示(跑马灯效果)
- Android 通过Matrix来对图片进行缩放,旋转和平移
- android实现图片上传功能(springMvc)
- 举例说明android中Bitmap、ListView以及ImageView的综合使用---
- android 云标签,文字墙(文字随机排列效果)
- android 开发:保存图片到SD卡上
- android学习笔记17:文字设置