手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >android中TabHost的图标(48×48)和文字叠加解决方法
android中TabHost的图标(48×48)和文字叠加解决方法
摘要:开发过程中,有时候图标稍微大点,比如48×48的时候,文字就会和图标叠加起来,解决方法如下:复制代码代码如下:TabWidgettw=tab...

开发过程中,有时候图标稍微大点,比如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); }

【android中TabHost的图标(48×48)和文字叠加解决方法】相关文章:

Android ListView数据绑定显示的三种解决方法

Android上使用jspf插件框架的方法

Android界面刷新的方法分享

Android中3种图片压缩处理方法

android开发基础教程—三种方式实现xml文件解析

android中ListView数据刷新时的同步方法

Android实现自定义带文字和图片Button的方法

android 实现圆角图片解决方案

android中添加按钮事件的方法

android FM播放时拔出耳机后FM APP自动close解决方法

精品推荐
分类导航