main.xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingTop="5.0dip" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="50.0dip"
android:background="@drawable/tab_frame_indicator"
android:gravity="center" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="5.0dip"
android:background="@drawable/tab_frame_separate" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</TabHost>
tab_frame_indicator.xml
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/tab_frame_focus" android:state_pressed="true"/>
<item android:drawable="@drawable/tab_frame_focus" android:state_focused="true" android:state_window_focused="true"/>
<item android:drawable="@drawable/tab_frame_focus" android:state_selected="true"/>
<item android:drawable="@drawable/tab_frame_background" />
</selector>
fl_tabhost_indicator_pitchon.xml
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tab_frame_indicator">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal" >
<ImageView
android:id="@+id/tab_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tab_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tab_image"
android:textAppearance="?android:textAppearanceSmall"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@android:color/white"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
效果图:
图片不会上传呀!!!
<!--StartFragment -->
- 大小: 11.1 KB
分享到:
相关推荐
该资源为一个tabhost 的ui布局,底部两栏的格式,点击课弹出相应 的界面以及点击和未点击有明显区别
实现主流界面的选项卡布局。 这里新建3个的Intent用于Activity的切换 Intent tab1 = new Intent(this, TabOneActivity.class); Intent tab2 = new Intent(this, TabTwoActivity.class); Intent tab3 = new Intent...
Android studio开发,布局TabHost布局 demo,包括修改tab布局: tab栏字体颜色,tab栏大小等布局.
TabHost布局文件 我们先来了解一下布局文件的基本内容: 1. 根标签及id 设置Android自带id : XML布局文件中, 可以使用 标签设置, 其中的id 需要引用 android的自带id : android:id=@android:id/tabhost ; getHost...
tabhost activity slidingMenu仿新浪微博布局可以作为一个小框架来重复使用,代码量不大,需要的朋友可以下载研究一下,默认编码GBK编译版本4.2.2 。
TabHost实现的分页效果,有部分功能可以参考
tabhost页面跳转需要用到的tabhost单例模式小例子,也有tabhost底部的布局
TabHost使用(自定义按钮菜单)
TabHost布局的框架,点击button按钮切换页面、随即更改字体颜色和背景图片。
tabHost布局之一_不继承TabActivity并以布局文件进行布局
适合新手的tabHost activity的布局框架
tabhost中嵌套一个tabhost。
但是当我们的需要是将tabhost显示在下方,并且点击一个tab时会出现一些样式变化,比如图片更换等效果,这种方式就不灵活了,所以我们得自己提出自己来自己布局TabHost,使之样式多样化。
使用了自定义button,自定义tabhost使用了不同默认的上标签切换页面
自定义TabHost 图片在左文字在右 可以结合修改为新的布局
百度用一个CustomTabHost.java来实现底部TabHost点击效果的,很漂亮,点击Tab的时候文字会上跑,图片会从底部跑出来的一个小动画。 我用自己的方法逆袭了他的CustomTabHost,感觉用起来比它的好用,而且简单不少!
TabHost+ViewPager实现滑动tabhost, viewPager;tabhost;滑动;源码
tabhost标签页面简单实现,这是学习android初期做的demo,
现今很流行的 TabHost的各种实现方式的代码