• 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

  • 相关阅读:
    Pycharm中安装第三方库
    Cookie&Session区别
    在线AES加解密
    Python_base_正则表达式
    POST四种常见的传参区别
    SQL基础语法与规则
    SQL的4种连接
    Python_base_Log
    <11>Golang基础进阶——指针
    Shell脚本——特殊变量
  • 原文地址:https://www.cnblogs.com/etgyd/p/2535180.html
Copyright © 2020-2023  润新知