RadioButton组也可通过添加上HorizontalScrollView 实现左右滑动

RadioButton组也可通过添加上HorizontalScrollView 实现左右滑动


[html]  view plain  copy
  1. <HorizontalScrollView  
  2.             android:id="@+id/huadong"  
  3.             android:layout_width="fill_parent"  
  4.             android:layout_height="fill_parent"  
  5.             android:gravity="center"  
  6.             android:scrollbars="none" >  
  7.   
  8.             <RadioGroup  
  9.                 android:id="@+id/radioGroup1"  
  10.                 android:layout_width="fill_parent"  
  11.                 android:layout_height="wrap_content"  
  12.                 android:gravity="center"  
  13.                 android:orientation="horizontal" >  
  14.   
  15.                 <RadioButton  
  16.                     android:id="@+id/radioALL"  
  17.                     android:layout_width="50dip"  
  18.                     android:layout_height="wrap_content"  
  19.                     android:layout_weight="1"  
  20.                     android:background="@null"  
  21.                     android:button="@null"  
  22.                     android:checked="true"  
  23.                     android:gravity="center"  
  24.                     android:text="全部"  
  25.                     android:textColor="@color/color_radiobutton"  
  26.                     android:textSize="18sp" />  
  27.   
  28.                 <RadioButton  
  29.                     android:id="@+id/radioA"  
  30.                     style="@style/radiobutton"  
  31.                     android:text="A" />  
  32.   
  33.                 <RadioButton  
  34.                     android:id="@+id/radioB"  
  35.                     style="@style/radiobutton"  
  36.                     android:text="B" />  
  37.   
  38.                 <RadioButton  
  39.                     android:id="@+id/radioC"  
  40.                     style="@style/radiobutton"  
  41.                     android:text="C" />  
  42.   
  43.                 <RadioButton  
  44.                     android:id="@+id/radioD"  
  45.                     style="@style/radiobutton"  
  46.                     android:text="D" />  
  47.   
  48.                 <RadioButton  
  49.                     android:id="@+id/radioE"  
  50.                     style="@style/radiobutton"  
  51.                     android:text="E" />  
  52.   
  53.                 <RadioButton  
  54.                     android:id="@+id/radioF"  
  55.                     style="@style/radiobutton"  
  56.                     android:text="F" />  
  57.   
  58.                 <RadioButton  
  59.                     android:id="@+id/radioG"  
  60.                     style="@style/radiobutton"  
  61.                     android:text="G" />  
  62.             </RadioGroup>  
  63.         </HorizontalScrollView>  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值