效果图

Tab添加左右按钮

主要是在自定义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 自定义RatingBar 不能显示半星问题
  2. Android 自定义视图
  3. Android 利用shape自定义进度条样式
  4. Android——新手指引 指定View高光显示自定义控件
  5. Android – 自定义Loading圆点
  6. android定义圆形按钮Shape,选中改变颜色
  7. android 实现按钮旋转720°
  8. Android Intent和按钮响应事件的几种方式
  9. Android Studio动态自定义编译输出的apk文件名

随机推荐

  1. androidの编辑联系人,姓名颠倒bug
  2. 关于解决 AVD的中文路径出现的问题和更改
  3. Ztorg木马分析: 从Android(安卓)root木马
  4. android aar 包含静态库的打包
  5. 38、Android编写应用-使用布局编辑器Layo
  6. Android(安卓)UI线程和非UI线程
  7. 远程调试Android/IOS设备/微信网页方法汇
  8. 边做iOS边学Android(二):认识几个常用的
  9. Android实现长按back键退出应用程序的方
  10. 【Android适配问题集锦-文件类】获取Andr