android中TabHost的图标(48×48)和文字叠加解决方法
时间:2023-05-19 14:13:28
开发过程中,有时候图标稍微大点,比如48×48的时候,文字就会和图标叠加起来,解决方法如下:
TabWidget tw = tabHost.getTabWidget();
for (int i = 0; i < tw.getChildCount(); i++)
{
TextView tv=(TextView)tw.getChildAt(i).findViewById(android.R.id.title);
ImageView iv=(ImageView)tw.getChildAt(i).findViewById(android.R.id.icon);
iv.setPadding(0, -8, 0, 0);
tv.setPadding(0, 0, 0, -2);
tv.setTextSize(12); }
标签:tabhost,图片叠加
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Scala中的mkString的具体使用方法
2023-11-16 00:18:18
Android系统自带分享图片功能
2022-08-03 09:14:07
超炫酷的WPF实现Loading控件效果
2023-11-19 23:53:20
![](https://img.aspxhome.com/file/2023/1/111281_0s.png)
关于Java中HashCode方法的深入理解
2022-05-28 03:29:33
![](https://img.aspxhome.com/file/2023/1/75791_0s.png)
Java设计模式之享元模式
2022-09-23 12:16:07
![](https://img.aspxhome.com/file/2023/3/66063_0s.jpg)
HttpServletResponse乱码问题_动力节点Java学院整理
2021-10-18 17:48:51
![](https://img.aspxhome.com/file/2023/2/78902_0s.jpg)
intellij idea使用git stash暂存一次提交的操作
2023-03-08 08:30:11
![](https://img.aspxhome.com/file/2023/5/63435_0s.jpg)
springboot-dubbo cannot be cast to问题及解决
2022-06-27 14:46:51
![](https://img.aspxhome.com/file/2023/0/75470_0s.png)
JPA like 模糊查询 语法格式解析
2022-06-16 20:43:42
Java内存缓存工具Guava LoadingCache使用解析
2023-05-25 08:36:36
简单了解Java字符串(操作)
2022-04-22 18:37:29
java线程之用Thread类创建线程的方法
2023-02-09 18:35:07
不可不知道的10个java谎言
2022-01-21 10:25:40
Java并发编程面试之线程池
2023-11-11 10:58:33
![](https://img.aspxhome.com/file/2023/4/58704_0s.png)
Android实现自动轮询的RecycleView
2023-10-17 15:45:17
java并发编程专题(一)----线程基础知识
2021-10-30 00:28:42
![](https://img.aspxhome.com/file/2023/7/116187_0s.jpg)
Spring Cloud 整合 nacos实现动态配置中心的详细步骤
2023-01-19 18:15:00
![](https://img.aspxhome.com/file/2023/3/77493_0s.jpg)
C#实现带消息数的App图标
2022-03-08 11:30:52
![](https://img.aspxhome.com/file/2023/2/108642_0s.jpg)
C++类中的六大默认成员函数详解
2022-09-18 01:33:01
![](https://img.aspxhome.com/file/2023/1/129531_0s.png)
Android EventBus 3.0.0 使用总结(必看篇)
2023-09-06 06:32:41
![](https://img.aspxhome.com/file/2023/9/129039_0s.jpg)