Android: borderStyle: 'dotted' | 'dashed' breaks when backgroundColor has opacity (Expo SDK 54)
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
When using borderStyle: 'dotted' or borderStyle: 'dashed' on a View, the border renders correctly only if the background color is fully opaque.
If the View has a borderColor with opacity (e.g. rgba(...) or a color with alpha), the border style does not render correctly (or is not applied at all).
This issue happens only on Android and seems to be a regression introduced in Expo SDK 54.
The same code works correctly in Expo SDK 53.
Snack (Android only):
👉 https://snack.expo.dev/@iamarad/border-style-issue?platform=android
Steps to reproduce
- Create a View
- Apply:
- borderWidth
- borderStyle: 'dotted' or borderStyle: 'dashed'
- Set a backgroundColor with opacity (e.g. rgba(0,0,0,0.1))
- Run on Android
React Native Version
0.81.4
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26200
CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-13400
Memory: 3.94 GB / 15.75 GB
Binaries:
Node:
version: 20.18.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 11.0.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-251.27812.49.2514.14217341
Visual Studio: Not Found
Languages:
Java: 17.0.12
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.4
wanted: 0.81.4
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
Not available!
MANDATORY Reproducer
https://snack.expo.dev/@iamarad/border-style-issue?platform=android
Screenshots and Videos
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先在 Android 上使用 React Native 0.81.4 和 Expo SDK 54 运行必需的 Snack,然后比较 SDK 53 中相同的 borderStyle 和半透明背景行为。跟踪 Android 对 View 点状和虚线边框的渲染路径;当 backgroundColor 使用 rgba 或 alpha 时两种样式都能正确渲染,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 50/100