Skip to content

Borders with opacity and border radius don't work on Android #49606

Open
@bloodysummers

Description

Description

There's a problem with the border on android when using a borderColor with some level of transparency. Not only that, but when combining it with any level of borderRadius turns into another problem.

The borders seem to be one over another when using transparency, this results in weird edges with a different color.
Then when adding borderRadius to the element, instead of the border being over the background, it grows outside of the element, so the transparency of the border will be merged with the background color of the container instead of the one on the element.

Steps to reproduce

  1. Add borderWidth and a borderColor with opacity (like rgba(0, 0, 0, 0.5) or #00000066) to a View.
  2. Add any borderRadius value to the View.

React Native Version

0.74.3

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.3
  CPU: (12) arm64 Apple M2 Pro
  Memory: 90.14 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
    path: ~/.volta/tools/image/node/20.17.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.volta/tools/image/yarn/1.22.22/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.volta/tools/image/node/20.17.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "31"
      - "34"
      - "35"
    Build Tools:
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

NA

Reproducer

https://snack.expo.dev/gYqgh7Tt16_kQ2g9Vcixy?platform=android

Screenshots and Videos

Image

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions