效果图

主要是在自定义tabHost添加两个按钮,这个定义方法与普通的定义相同,这里就不再说明了。

xml布局:

 1 <LinearLayout  2 android:orientation="horizontal" 3 android:layout_width="fill_parent" 4 android:layout_height="wrap_content" 5 > 6 <ImageButton 7 android:id="@+id/left" 8 android:layout_height="wrap_content" 9 android:layout_width="wrap_content"10 android:background="@drawable/left"11 android:layout_weight="1"12 />13 <HorizontalScrollView android:layout_width="fill_parent"14 android:id="@+id/hsv"15 android:layout_weight="5"16 android:layout_height="wrap_content" android:fillViewport="true"17 android:scrollbars="none" >18 <TabWidget android:id="@android:id/tabs"19 android:layout_width="fill_parent" android:layout_height="wrap_content" />20 21 </HorizontalScrollView>22 <ImageButton 23 android:id="@+id/right"24 android:layout_weight="1"25 android:layout_height="wrap_content"26 android:layout_width="wrap_content"27 android:background="@drawable/right"28 />29 </LinearLayout>

对于要显示的tabHost可以通过java进行实现,也可以设置HorizontalScrollView滑动到当前的tab

更多相关文章

  1. Android(安卓)HIDL 简介
  2. Android(安卓)自定义视图
  3. 【Android(安卓)Demo】图片之滑动效果(Gallery)
  4. Android属性 bulid.prop等
  5. 解决Android(安卓)自定义RatingBar 不能显示半星问题
  6. 调整recovery界面菜单字体大小
  7. android中动态和静态版本都有的库
  8. android嵌套滑动- Material Design
  9. Android(安卓)利用shape自定义进度条样式

随机推荐

  1. 多字文本android:ellipsize属性不正常工
  2. Espresso 开源了
  3. android瀑布流代码
  4. Android中延时执行的几种方法
  5. 同程面试经历 android开发工程师
  6. android 使用hideapi
  7. Android ArrayAdapter 源码查看 深入了解
  8. android UI注册登录界面
  9. DES加解密方法(C#和android通用)
  10. Android(安卓)设计模式 之 单例模式