Giter Site home page Giter Site logo

Comments (4)

GoldenMaximo avatar GoldenMaximo commented on May 26, 2024 5

Why is this closed? I'm still unable to set borderRadius on RectButton.

Setting borderRadius on RectButton does not actually round the corners. Current workaround is to wrap a RectButton with a View that has a borderRadius set.

Didn't work either.

Screenshot_1

The border represents the view wrapping the RectButton and the grey area the RectButton itself.

Code:

<View style={style.borderRadiusOf50}>
  <RectButton>
    <View accessible style={[style.square, style.squareTypeOne]}>
      <Image
        resizeMode="center"
        source={oxygenLogo}
        style={style.logo}
      />
      <Text style={style.buttonLabel}>
        Recarga de cilindros de oxigênio
      </Text>
    </View>
  </RectButton>
</View>

Solution

I found out while writing this comment that RectButton needs backgroundColor for borderRadius to work. I also just checked the docs and there's nothing mentioning this requisite in there so it's kinda unintuitive.

from react-native-gesture-handler.

osdnk avatar osdnk commented on May 26, 2024 3

This issue has been reffered in one of PRs. As soon as it will have been merged, I suppose the problem will be solved.
I close the issue

from react-native-gesture-handler.

vpodolyan avatar vpodolyan commented on May 26, 2024

The same with borderWidth and borderColor

from react-native-gesture-handler.

kesha-antonov avatar kesha-antonov commented on May 26, 2024

Why is this closed? I'm still unable to set borderRadius on RectButton.

Setting borderRadius on RectButton does not actually round the corners. Current workaround is to wrap a RectButton with a View that has a borderRadius set.

Didn't work either.

Screenshot_1

The border represents the view wrapping the RectButton and the grey area the RectButton itself.

Code:

<View style={style.borderRadiusOf50}>
  <RectButton>
    <View accessible style={[style.square, style.squareTypeOne]}>
      <Image
        resizeMode="center"
        source={oxygenLogo}
        style={style.logo}
      />
      <Text style={style.buttonLabel}>
        Recarga de cilindros de oxigênio
      </Text>
    </View>
  </RectButton>
</View>

Solution

I found out while writing this comment that RectButton needs backgroundColor for borderRadius to work. I also just checked the docs and there's nothing mentioning this requisite in there so it's kinda unintuitive.

Thanks! Setting backgroundColor helped

from react-native-gesture-handler.

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.