Skip to content

borderRadius on RectButton on Android #59

Closed

Description

@brentvatne

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.

Activity

  1. vpodolyan commented on Mar 30, 2018

    @vpodolyan

    The same with borderWidth and borderColor

  2. osdnk commented on Apr 25, 2018

    @osdnk
    Contributor

    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

  3. GoldenMaximo commented on Sep 6, 2019

    @GoldenMaximo

    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.

  4. kesha-antonov commented on Sep 25, 2020

    @kesha-antonov

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions