Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for transparent large header on iOS (#2501)
## Description - requires this bug fix #2500 - make it possible to support the stock Apple behavior where the large header is transparent and the collapsed header is blurry with a shadow. This is currently not possible because we inherit the blur effect from the collapsed title, and because there's no way to set the headerLargeTitle blur effect. With this change, the default iOS behavior can more closely be matched by using the following props: ```js { headerLargeTitle: true, headerTransparent: true, headerBlurEffect: "systemChromeMaterial", headerLargeTitleShadowVisible: false, headerShadowVisible: true, headerLargeStyle: { // NEW: Make the large title transparent to match the background. backgroundColor: "transparent", }, } ``` Without the shadow changes, users also need to add this (and adjust for dark mode): ``` { headerStyle: { // Hack to ensure the collapsed small header shows the shadow / border. backgroundColor: "rgba(255,255,255,0.01)", }, } ``` ## Changes ### Before This is the best we can currently do. ![IMG_5976](https://github.com/user-attachments/assets/00d2b4d0-9633-44c1-a038-c311f4e51df1) ### After https://github.com/user-attachments/assets/b1e8999d-14ce-40ef-aef6-2478a9e6326c <!-- Please describe things you've changed here, make a **high level** overview, if change is simple you can omit this section. For example: - Updated `about.md` docs --> <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. --> ## Test code and steps to reproduce <!-- Please include code that can be used to test this change and short description how this example should work. This snippet should be as minimal as possible and ready to be pasted into editor (don't exclude exports or remove "not important" parts of reproduction example) --> ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
- Loading branch information