Android) Switch track is not visible when it is disabled and the parent has a dark background
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
Switch doesn't display the track if:
- It is an Android device
- Switch has
disabled={true} - Container background is
black
Expected Results
Switch should display the track with a gray color
Snack, code example, screenshot, or link to a repository:
snack: https://snack.expo.io/@rubengt01/switch-with-dark-background
screenshot:

react-native info
System:
OS: macOS 11.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 168.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.9.2 - ~/.nvm/versions/node/v12.18.4/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/Ruben/.rvm/rubies/ruby-2.6.1/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 14.0.2 - /usr/bin/javac
Python: 2.7.16 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 Android 上使用黑色背景的父元素,复现所链接 Expo Snack 中被禁用的 Switch case。跟踪 React Native Android Switch 的入口点,并将被禁用 track 的渲染与预期的灰色 track 进行比较。在这些条件下 track 仍保持可见且为灰色,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100