react / react/react-native

[iOS 26] Switch with custom thumb color is losing color when coming back to app

未关闭
#53,856 9 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: Switch iOS 26 Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

Using iOS 26, when you give a switch custom thumb colors, go to another app, come back to your app, then the custom colors are lost.

Steps to reproduce
  1. Install the application on iOS 26.
  2. Enable one of the toggles.
  3. Switch app and come back.
  4. Thumbs of switches which used to have a custom thumb color are white.
React Native Version

0.81.4

Affected Platforms

Runtime - iOS 26

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.6.1
  CPU: (12) arm64 Apple M2 Pro
  Memory: 129.11 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.18.0
    path: ~/.nvm/versions/node/v22.18.0/bin/node
  Yarn:
    version: 4.6.0
    path: ~/.nvm/versions/node/v22.18.0/bin/yarn
  npm:
    version: 10.9.3
    path: ~/.nvm/versions/node/v22.18.0/bin/npm
  Watchman:
    version: 2025.09.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/regina/.gem/ruby/3.2.2/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13363775
  Xcode:
    version: 26.0/17A324
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/regina/.rubies/ruby-3.2.2/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: 0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
N/A
MANDATORY Reproducer

https://github.com/Regina-v/rn-ios26-switch-custom-color-bug

Screenshots and Videos

Screen record iOS 26: https://github.com/user-attachments/assets/33e01479-e9f7-4e29-9719-e9128a2ce1b9

Screen record iOS 18: https://github.com/user-attachments/assets/7b67f017-3ecd-46e7-accf-4b2773026c25

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

https://github.com/Regina-v/rn-ios26-switch-custom-color-bug 中的必需复现项目开始,按照报告中的说明,在 iOS 26 上复现 switch 的行为,并与 iOS 18 进行比较。跟踪 React Native 的 switch 实现,并验证离开应用后再返回时自定义 thumb 颜色仍然保留;当报告的颜色丢失问题不再发生时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, react-native
领域
mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。