区块链、APP、公众号、小程序、物联网、智能硬件、网站开发新模式,安全,超速,可控。
当前位置:首页 > 资源中心 > Android 类似iOS的Segment Control控件
资源详情

Android 类似iOS的Segment Control控件


类似iOS的Segment Control控件

xml:

<com.simple.widgets.SegmentView xmlns:android="http://schemas.android.com/apk/res/android"  android:id="@+id/rg" android:layout_width="wrap_content"  android:layout_height="wrap_content"  android:layout_centerHorizontal="true"  android:layout_gravity="top|center"  android:layout_margin="10dp"  android:background="@drawable/segment_shape"  android:gravity="center"  android:orientation="horizontal" />

java:
SegmentView rGroup = (SegmentView) findViewById(R.id.rg); // 默认为横向排列,如上图所示,如需纵向排列请调用setOrientation方法  // rGroup.setOrientation(SegmentView.VERTICAL);  // 设置tabs  rGroup.setTabs(new String[] { "主页", "朋友圈", "搜索" });
 // 设置点击事件  rGroup.setOnItemCheckedListener(new OnItemCheckedListener() {
 @Override  public void onCheck(RadioButton button, int position, String title) {
 Toast.makeText(getApplicationContext(), "checked id = " + position + ", title = " + title, Toast.LENGTH_SHORT).show();
      }
 });

GitHub地址:https://github.com/hehonghui/SegmentView

资源介绍
yue 来源者
资源名称:Android 类似iOS的Segment Control控件
格式:zip
大小:150K
颜色:
风格:
上传时间:2017-12-05
资源价格:
0.00
你可能在找这些资源
版权所有 © 2017 ymznkf.com. 成都玉目科技有限公司 蜀ICP备17032468号-1