Giter Site home page Giter Site logo

Comments (5)

Karthik-B-06 avatar Karthik-B-06 commented on June 6, 2024 1

Hey @theneekz. Understood the issue.

Screenshot 2021-04-15 at 10 44 28 PM

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.

  1. Taking out the border radius of the container as a separate prop.
  2. Or moving segmentedControlWrapper before the containerStyle 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.

theneekz avatar theneekz commented on June 6, 2024 1

from react-native-segmented-control.

theneekz avatar theneekz commented on June 6, 2024

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.

Karthik-B-06 avatar Karthik-B-06 commented on June 6, 2024

@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.

Screenshot 2021-04-23 at 10 34 36 PM

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.

Karthik-B-06 avatar Karthik-B-06 commented on June 6, 2024

@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.

Screenshot 2021-04-24 at 10 18 00 AM

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)

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.