react / react/react-native

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

Abierto
#49,606 8 comentarios 0 reacciones 1 asignado Ver en GitHub

@jorge-cab ya está trabajando en esto.

Desde el 26/2/2025.

Issue: Author Provided Repro Platform: Android Type: Unsupported Version
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

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/@ldiaz-occ/border-error-on-android

Screenshots and Videos
Image

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.