解决方案 »
- 求助,eclipse下启动Android虚拟机无法运行项目,并且不断启动新AVD
- Android获取当前详细位置,求指引!
- 急急急。想做一个android的crm管理系统,谁能给点建议呢?
- boa移植到android上,改写Android.mk时出错。。。
- “修改页面”中的空指针问题
- 请问Android SDK 1.6开发的程序能否运行在android2.1的手机上?
- 新浪微博授权
- 关于横竖屏切换问题,求前辈们解答一下
- 图片圆角问题
- 百度地图定位失败,日记显示galaxy lib host missing meta-data
- [2012-07-12 15:35:33 - DeviceMonitor] Adb connection Error:远程主机强迫关闭了一个现有的连接。
- 请问在android系统中如何用Socket发送一个结构体,并且和VC程序互相解析结构体
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" > <RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" > <FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="50dp"
>
</FrameLayout>
<TabWidget
android:layout_alignParentBottom="true"
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</TabWidget>
</RelativeLayout>
</TabHost>
TabHost tabHost = getTabHost(); TabSpec tabSpec1 = tabHost.newTabSpec("tag1");
TabSpec tabSpec2 = tabHost.newTabSpec("tag2"); tabSpec1.setIndicator(getIndicator(R.drawable.tab_main_nav_me, "个人中心"));
tabSpec2.setIndicator(getIndicator(R.drawable.tab_main_nav_book, "新书"));
Intent tabSpec1Intent = new Intent(this, MyDouActivity.class);
Intent tabSpec2Intent = new Intent(this, NewBookActivity.class);
tabSpec1.setContent(tabSpec1Intent);
tabSpec2.setContent(tabSpec2Intent);
tabHost.addTab(tabSpec1);
tabHost.addTab(tabSpec2);/**
* 自定义的VIew
* @param resId
* @param charSequence
* @return
*/
public View getIndicator(int resId, CharSequence charSequence) {
View view = View.inflate(getApplicationContext(), R.layout.mydou_tapspec, null);
ImageView imageView = (ImageView) view.findViewById(R.id.iv_mydou_tapspac_image);
TextView textView = (TextView) view.findViewById(R.id.tv_mydou_tapspec_text);
imageView.setImageResource(resId);
textView.setText(charSequence);
return view;
}