Commit 9f43d07
Fix Switch layout with iOS26 (#53326)
Summary:
Pull Request resolved: #53326
Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).
The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.
## Changelog:
[iOS][Fixed] - Fix Switch layout to work with iOS26
Reviewed By: sammy-SC
Differential Revision: D80454350
fbshipit-source-id: 1d468910276f7fde4559d2ae87cf60c8494caceb1 parent 8d77592 commit 9f43d07
File tree
2 files changed
+2
-1
lines changed- packages/react-native
- Libraries/Components/Switch
- src/private/specs_DEPRECATED/components
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
0 commit comments