Comments (8)
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.
@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.
hi!
thanx for the update.
what i ment about center align is illustrated in the attached image
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.
@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.
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.
You are welcome! 😸
from react-native-simple-radio-button.
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.
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)
- onPress called with different param type
- TestID does not work HOT 2
- I made three radio buttons using pro, the last one is not clickable
- How to style button label in RadioForm
- buttonColor prop not working on selected radio button HOT 1
- Initial is not working on radio form tag HOT 1
- Misleading README.md HOT 1
- how to put a separator in between radio buttons like as shown in customizable example? HOT 1
- Label gets cut off for fontSize > 22
- React.createClass deprecated HOT 1
- make the selected label bold HOT 1
- rtl radio HOT 3
- This lib added totally unwanted animations to my project in Android
- Move radio button to next row if more then 2
- maxFontSizeMultiplier for RadioButtonLabel
- how to bind selected value in initial HOT 1
- setstate of hook inside onPress not working ! HOT 1
- How to reset the value of the radio buttons?
- Is Selected by Value
- Not accessible (a11y)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-simple-radio-button.