GithubHelp home page GithubHelp logo

Comments (8)

VenkateshSomu avatar VenkateshSomu commented on August 11, 2024 1

How to set different color for active label and inactive label color. Right now if we set labelColor="#000" it is effecting to the non selected radio label text.I want to apply label color green for the selected item @moschan

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

@cmdillon
Thank you for your interest.:smile_cat:
Good question. I updated this component to ver1.2.0 .

You can use like this:

<Radio
  radio_props={radio_props}
  initial={0}
  labelColor={'#50C900'}
/>

and what do you mean about center align?
You can see my example. If you don't like this, could you submit example image or code?

Thank you!

from react-native-simple-radio-button.

cmdillon avatar cmdillon commented on August 11, 2024

hi!

thanx for the update.

what i ment about center align is illustrated in the attached image

42082ad4-d578-4600-b655-b8f8cb78365c

as you can see the text is center aligned. using the styles: “alignItems: center”, “alignSelf: center” or "justifyContent : center” has no effect.

ie, <Radio
  radio_props={radio_props}
  initial={0}
  labelColor={'#50C900’}
 style={{ alignItems: center }}
/>

also is it possible to use this with more than one group of radio buttons? basically i have 2 groups of radio buttons on every scene and i have 6 scenes. so i would need to be able to get the value of each individual selected button in the groups.

would be really helpful to get some feedback about this...

regards

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

@cmdillon
Sorry for late reply 😣

I updated this component.

I added more customizable mode like this:

<Radio
  formHorizontal={true}
  animation={true}
>
  {this.state.types.map((obj, i) => {
    var that = this
    var is_selected = this.state.isSelected == i;
    return (
      <View style={styles.radioButtonWrap}>
        <RadioButton
          isSelected={is_selected}
          obj={obj}
          key={i}
          labelHorizontal={false}
          buttonColor={'#2196f3'}
          labelColor={'#000'}
          style={styles.radioStyle}
          onPress={(value) => {
            this.setState({value:value})
            that.setState({isSelected: i})
          }}
        />
      </View>
    )
  })}
</Radio>

and, if you want to use multiple radio buttons, you have to prepare multiple value.

You can see my NEW example. I prepared example for you!
If you don't like this, you can ask me without hesitation! 👍

from react-native-simple-radio-button.

cmdillon avatar cmdillon commented on August 11, 2024

hi, cool! thanx a lot!

i have another question actually 2 :) but as not to highjack this thread i'll post it anew.

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

You are welcome! 😸

from react-native-simple-radio-button.

cmdillon avatar cmdillon commented on August 11, 2024

hi!

hmmm, i know we talked about passing in the color for the labels, but would it be possible to be able to pass in more than that? something like this would be cool: labelStyles={...}

this way one could have more control over the labels positioning etc

from react-native-simple-radio-button.

moschan avatar moschan commented on August 11, 2024

Yes. I see.
If you want to use more controllable radio buttons, you can use customizable style like a previous post now.

But, I'm thinking that I refactor and improve this component based on your idea in the near future. 😸

from react-native-simple-radio-button.

Related Issues (20)

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.