Giter Site home page Giter Site logo

multilineradiogroup's Introduction

MultiLineRadioGroup

RadioGroup with multiLine (多行的RadioGroup)

程序截图:

http://img.my.csdn.net/uploads/201505/07/1430962690_1083.jpg http://img.my.csdn.net/uploads/201505/07/1430962690_4852.jpg http://img.my.csdn.net/uploads/201505/07/1430962690_6160.jpg

使用说明:

1.定义一个MultiLineRadioGroup的layout(Define a layout to hold the MultiLineGroup);

<org.ccflying.MultiLineRadioGroup
    android:id="@+id/content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:child_count="8"
    app:child_layout="@layout/child"
    app:child_margin_horizontal="6.0dip"
    app:child_margin_vertical="2.0dip"
    app:child_values="@array/childvalues"
    app:gravity="1"
    app:single_choice="true" >
</org.ccflying.MultiLineRadioGroup>

2.为MultiLineGroup指定单个Child元素对应的layout资源,该layout资源的要节点必须是CheckBox (define the attr child_layout in MultiLineRadioGroup,which root is a CheckBox.);

<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content" />

3.指定其它属性

child_count : 指定默认child个数;
child_margin_horizontal : 指定child水平间距;
child_margin_vertical : 指定child垂直间距;
child_values : 指定child的textArray值(一个string-array);
single_choice : 单选或多选;
gravity : 对齐方式    1(left) 0(center) 2(right);

4.部分方法

  • append(String str) 附加一个child;
  • insert(int position, String str) 往指定位置插入child;
  • getCheckedValues()|getCheckedItems() 获取选中项;
  • remove(int position) 删除指定位置的child;
  • setItemChecked(int position) 选中指定位置的child;
  • setGravity(int gravity) 设定child的对齐方式(left|right|center);
  • ...

multilineradiogroup's People

Contributors

a284628487 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multilineradiogroup's Issues

有一个使用上的BUG,child单选问题

就是每一个child如果是radiobutton效果的话,在单选的情况下,是不能取消选中的。也就是你点击这个child他不会呈现未选中状态,但是这个里面点击了child会变成未选中状态。

提问

我用你这个做了一个选号器,号码0-9,在android4.4或者以下的手机上运行的时候,要出现加载出来全部是0这个号码的情况,怎么解决的,困扰了好久都没有解决这个问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.