Android编程实现设置TabHost当中字体的方法
Android编程实现设置TabHost当中字体的方法
发布时间:2016-12-28 来源:查字典编辑
摘要:本文实例讲述了Android编程设置TabHost当中字体的方法。分享给大家供大家参考,具体如下:TabWidgettw=this.getT...

本文实例讲述了Android编程设置TabHost当中字体的方法。分享给大家供大家参考,具体如下:

TabWidget tw=this.getTabWidget();//设置TabHost当中的内容的方法 for(int i=0;i<tw.getChildCount();i++){ //设置TabHost字体的相关方法 TextView tv=(TextView)tw.getChildAt(i).findViewById(android.R.id.title); tv.setGravity(BIND_AUTO_CREATE); tv.setPadding(10, 10, 10, 10); tv.setTextSize(20); tv.setTextColor(Color.GREEN); //同理,设置TabHost背景图片的相关方法如下 ImageView iv=(ImageView)tw.getChildAt(i).findViewById(android.R.id.icon); iv.setAlpha(1);//设置透明度,设置背景图片的其他属性,在此不一一列举! }

希望本文所述对大家Android程序设计有所帮助。

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新安卓软件开发学习
热门安卓软件开发学习
编程开发子分类