Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iOS): add missing largeTitleBackgroundColor prop #2500

Conversation

@kkafar kkafar changed the title add missing largeTitleBackgroundColor prop for iOS fix(iOS): add missing largeTitleBackgroundColor prop Nov 14, 2024
@kkafar kkafar self-requested a review November 14, 2024 09:11
@kkafar kkafar self-assigned this Nov 14, 2024
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I've checked CI - it fails since yesterday with the same issue, changes you introduced are not related.

@kkafar kkafar merged commit a1dbae1 into software-mansion:main Nov 14, 2024
4 of 5 checks passed
kkafar pushed a commit that referenced this pull request Nov 14, 2024
## 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
@EvanBacon EvanBacon deleted the @evanbacon/fix-ios-large-title-background-color branch November 16, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants