Comments (5)
Hey @theneekz. Understood the issue.
You are trying to set the value using containerStyle
prop which gets overridden by my segmentedControlWrapper style.
There are 2 possible solutions I can think of right away.
- Taking out the border radius of the container as a separate prop.
- Or moving
segmentedControlWrapper
before thecontainerStyle
so that the user-given styles are correctly overridden.
Which one of the above two you think is more apt?
from react-native-segmented-control.
from react-native-segmented-control.
Hey @Karthik-B-06, thanks for the response.
I would think that you would want to put the containerStyle
second in the array, to allow custom styles to override the default... But maybe only allow certain properties? Like how textStyle allows all style properties except the label colors set by props? I don't know enough about View styles to know what will interfere with functionality.
from react-native-segmented-control.
@theneekz
I am sorry for the delay.
Tried enabling the border-radius to work by overriding the values. But the style structure of segmented control breaks.
I should probably have to think of a work-around for this. Rest assured I will get back with a solution. :) Thank you for your patience.
from react-native-segmented-control.
@theneekz A new version supporting change of borderRadius
through containerStyle
props is available.
You will have to use something like this so that the style structure does not break.
<SegmentedControl
tabs={["Label", "Label"]}
onChange={() => {}}
paddingVertical={6}
containerStyle={{
marginVertical: 20,
borderRadius: 15,
}}
tileStyle={{
borderRadius: 15,
}}
currentIndex={tabIndex}
onChange={handleTabsChange}
theme={theme}
/>
Which will look something like this.
Added a new prop tileStyle
to match the borderRadius
of the container.
Closing this issue for now 🎉 .
If you are still facing any issues feel free to reopen it. :)
from react-native-segmented-control.
Related Issues (15)
- Todos for v0.1.6
- Add type definitions
- Badge in segment bar. HOT 3
- please ad active text style prop HOT 1
- Show information according to the tabs that have been selected HOT 12
- README broken image links HOT 1
- Add support for overriding animation style HOT 1
- Segmented control not rendering correctly HOT 1
- feature requests
- Does not render correctly with flex HOT 1
- Conflict in Android with other react-native-reanimated versions? HOT 15
- [Feature request] Add support for RTL phones HOT 3
- Problem after upgrading from 0.2.9 HOT 7
- Warning with shadowStyle HOT 1
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-segmented-control.