TabHost问题求高手 请问怎么将每一个选项卡所设置的图片自动适应填充到所在的选项卡中,图中的icon显得很小很孤立,能不能让它填满,在线等 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自定义Indicator public void setIndicater(TabSpec body, String title, Drawable icon,TabWidget tabWidget, Context context) { RelativeLayout tabIndicator1 = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.indicater, tabWidget,false); TextView textView = (TextView)tabIndicator1.getChildAt(1); textView.setText(title); ImageView imageView = (ImageView)tabIndicator1.getChildAt(0); imageView.setImageDrawable(icon); body.setIndicator(tabIndicator1); } 请问下2楼,自定义的这个setIndicater方法,是直接放在创建TabHost的Activity中吗tabHost.addTab(tabHost.newTabSpec("").setIndicator("",getResources().getDrawable(R.drawable.chinese_food)).setContent(R.id.linerlayout2));这是我添加tab的语句,是不是要把这其中setIndicator("",getResources().getDrawable(R.drawable.chinese_food))用自定义的setIndicater方法替代呢 tabSpec = tabHost.newTabSpec(getString(R.string.FE_LOCAL_FILES)); setIndicater(tabSpec, getString(R.string.local), getResources().getDrawable(R.drawable.filebrowser_local_icon),tabWidget, this); intent = new Intent(..........); intent.putExtra("KEY_FILE_TYPE", fileType); tabSpec.setContent(intent); tabHost.addTab(tabSpec); android listview item点击,菜鸟求助 android平板电脑开发问题 有关startActivityForResult()和onActivityResult()之疑惑? Android下怎么诊断/防止程序的内存泄漏/内存碎片,大家有没什么好方法 android上的RIA应用 数据存储与访问的问题 android流媒体 引用文件时出错 push消息的解析 application使用的问题 安卓怎么和数据库链接啊 android中如何区分UI主线程和子线程
public void setIndicater(TabSpec body, String title, Drawable icon,TabWidget tabWidget, Context context)
{
RelativeLayout tabIndicator1 = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.indicater, tabWidget,false);
TextView textView = (TextView)tabIndicator1.getChildAt(1);
textView.setText(title);
ImageView imageView = (ImageView)tabIndicator1.getChildAt(0);
imageView.setImageDrawable(icon);
body.setIndicator(tabIndicator1);
}
setIndicater(tabSpec, getString(R.string.local),
getResources().getDrawable(R.drawable.filebrowser_local_icon),tabWidget, this);
intent = new Intent(..........);
intent.putExtra("KEY_FILE_TYPE", fileType);
tabSpec.setContent(intent);
tabHost.addTab(tabSpec);