类似android qq一样的可以收缩的listview怎么弄啊 类似android qq一样的可以收缩的listview,收缩栏可以自定义颜色。请问应该怎么写啊!请高手不吝赐教。谢谢啦!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 收缩?是指ExpandableListView吗?自定义颜色什么的是自己重写Adapter吧 你说的应该是树控件ExpandableListView ExpandableListActivity这个控件可是实现ListView,然后每个还可以点开。具体写法可以参考源码里面的例子。 ExpandableListActivity写过。现在要把ExpandableListActivity写到一个TabHost里面。能给点思路吗? protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //1>.得到一个TabHost TabHost tabHost = getTabHost(); //2>.加入ExpandableListActivity tabHost.addTab(this.buildTabSpec(tabHost, new Intent().setClass(this,ExpandableListActivity.class ), this.getString(R.string.mp3_list_remote), 0)); //2>.加入ExpandableListActivity tabHost.addTab(this.buildTabSpec(tabHost, new Intent().setClass(this,ExpandableListActivity.class ), this.getString(R.string.mp3_list_local), 0)); } /** * 构建一个TabSpec * @return */ private TabHost.TabSpec buildTabSpec(TabHost tabHost,Intent intent ,String title, int pic) { //1>.代表一个TabHost一个页面 TabHost.TabSpec tabSpec = tabHost.newTabSpec(title); //2>.获得系统默认图片 Resources res = getResources(); //3.设置一个Indicator,如果pic为0就设置为默认图片 tabSpec.setIndicator(title,res.getDrawable( 0 == pic ? android.R.drawable.stat_sys_download : pic )); //4>.设置remoteSpec的内容,就是一个intent内容 tabSpec.setContent(intent); return tabSpec; } 请指教!关于因为内存不够应用被回收的问题,如何解决或者避免? android 短信过长问题 android3.0打开菜单 生成图片 安卓报错 如何去掉照相机退出时的动画 Android应用程序怎么通过socket跟守护进程通信?必须写一个framework层?怎么写? Android 多点触摸和手势设计 急:安卓手机相同设备ID问题怎么解决? 如何准确调出Android系统相册 anroid 应用取得 root权限 如何使peerdroid sample运行啊。。
自定义颜色什么的是自己重写Adapter吧
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//1>.得到一个TabHost
TabHost tabHost = getTabHost();
//2>.加入ExpandableListActivity
tabHost.addTab(this.buildTabSpec(tabHost, new Intent().setClass(this,ExpandableListActivity.class ),
this.getString(R.string.mp3_list_remote), 0));
//2>.加入ExpandableListActivity
tabHost.addTab(this.buildTabSpec(tabHost, new Intent().setClass(this,ExpandableListActivity.class ),
this.getString(R.string.mp3_list_local), 0));
}
/**
* 构建一个TabSpec
* @return
*/
private TabHost.TabSpec buildTabSpec(TabHost tabHost,Intent intent ,String title, int pic) { //1>.代表一个TabHost一个页面
TabHost.TabSpec tabSpec = tabHost.newTabSpec(title); //2>.获得系统默认图片
Resources res = getResources();
//3.设置一个Indicator,如果pic为0就设置为默认图片
tabSpec.setIndicator(title,res.getDrawable( 0 == pic ? android.R.drawable.stat_sys_download : pic ));
//4>.设置remoteSpec的内容,就是一个intent内容
tabSpec.setContent(intent);
return tabSpec;
}