React-native-gesture-handler: borderRadius on RectButton on Android

Created on 23 Nov 2017  路  4Comments  路  Source: software-mansion/react-native-gesture-handler

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.

Most helpful comment

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.

All 4 comments

The same with borderWidth and borderColor

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

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.

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

Was this page helpful?
0 / 5 - 0 ratings