Preparing customized radio group type of layout

前端 未结 7 571
生来不讨喜
生来不讨喜 2020-12-30 08:49

I am trying to prepare custom radiogroup like layout in the below image. I have nearly 8-10 rows to do that. So, I prepared one linear layout w

7条回答
  •  無奈伤痛
    2020-12-30 09:23

    A bit late to answer, but I meet with the same problem and out of frustration I wrote a new class called RadioGroupPlus to solve this problem, and I wanted to share.

    The repo can be found here: https://github.com/worker8/RadioGroupPlus/

    How to install

    Add the library in your top level build.gradle:

    allprojects {
        repositories {
            maven { url "https://jitpack.io" }
        }
    }
    

    In your app/build.gradle, add this as dependency:

    compile 'com.github.worker8:RadioGroupPlus:v1.0.1'
    

    How to use

    In your xml, wrap your custom layout with , such as:

    
            
               
               
               
            
            
               
               
               
            
            
               
               
               
            
    
    

    I leave out the details on purpose so that it's easier to read. I wrote more information about how to use RadioGroupPlus in the README page. Besides I also write a simple example of how to use it. So if you need to know more, you can learn more in the RadioGroupPlus repo.

    Hope it helps!

提交回复
热议问题