You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(iOS, Stack): center subview not visible/misaligned in header (#3489)
## Description
Fixes missing/misaligned center subview in header on iOS.
| before | after |
| --- | --- |
| <img width="1206" height="2622" alt="before"
src="https://github.com/user-attachments/assets/b38a076e-3d80-42f5-8bd3-12a649e856f1"
/> | <img width="1206" height="2622" alt="after"
src="https://github.com/user-attachments/assets/81ddc53d-f6a2-46fc-9a5b-566c42828408"
/> |
Fixes#3482.
## Changes
- limit wrapping subviews and related logic to left and right subviews
only on iOS 26+ (previously, there was only an SDK macro, without
runtime check)
## Test code and steps to reproduce
Run `Test3446` to verify that pressables are still working. To test
center subview, use:
<details>
<summary>Test example</summary>
```tsx
import React from 'react';
import { View, Text } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Colors from '../shared/styling/Colors';
function MainScreen() {
return <View style={{ backgroundColor: 'moccasin' }} />;
}
const Stack = createNativeStackNavigator();
export default function App() {
return (
<Stack.Navigator>
<Stack.Screen
name="Main"
component={MainScreen}
options={{
headerLeft: () => <Text>a</Text>,
headerTitle: () => <Text>b</Text>,
headerRight: () => <Text>c</Text>,
headerBackground: () => (
<View
style={{
backgroundColor: Colors.PurpleLight80,
width: '100%',
height: 120,
}}
/>
),
}}
/>
</Stack.Navigator>
);
}
```
</details>
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
0 commit comments