Android编程实现设置TabHost当中字体的方法
本文实例讲述了Android编程设置TabHost当中字体的方法。分享给大家供大家参考,具体如下:
TabWidgettw=this.getTabWidget();//设置TabHost当中的内容的方法
for(inti=0;i<tw.getChildCount();i++){
//设置TabHost字体的相关方法
TextViewtv=(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背景图片的相关方法如下
ImageViewiv=(ImageView)tw.getChildAt(i).findViewById(android.R.id.icon);
iv.setAlpha(1);//设置透明度,设置背景图片的其他属性,在此不一一列举!
}
希望本文所述对大家Android程序设计有所帮助。