Skip to content

[iOS] Add title customization to scroll edge appearance#8207

Open
Beat-YT wants to merge 6 commits intowix:masterfrom
Beat-YT:master
Open

[iOS] Add title customization to scroll edge appearance#8207
Beat-YT wants to merge 6 commits intowix:masterfrom
Beat-YT:master

Conversation

@Beat-YT
Copy link
Contributor

@Beat-YT Beat-YT commented Jan 20, 2026

Add scrollEdgeAppearance title styling support (iOS)

What

This PR adds support for configuring top bar title styling specifically for
scrollEdgeAppearance on iOS
.

UIKit treats scrollEdgeAppearance as a full UINavigationBarAppearance,
including titleTextAttributes. Previously, React Native Navigation always
applied the same title attributes to both the standard and scroll-edge
appearances, making it impossible to customize the title when the scroll edge
state is active.

This change exposes scroll-edge title configuration.


API

topBar: {
  title: {
    text: 'Artists',
    color: 'white',
    fontSize: 18
  },
  scrollEdgeAppearance: {
    active: true,
    title: {
      color: 'white',
      fontSize: 26,
      fontWeight: 'bold',
    },
  },
}

Demo

Tests

This change affects UIKit UINavigationBarAppearance behavior and depends on
scroll-edge state, which is not easily assertable via unit or e2e tests.
The behavior was verified manually using a scrollable screen and is demonstrated
in the attached GIF.

Notes

  • iOS only
  • Backwards compatible
  • No impact on Android

Beat-YT and others added 3 commits January 19, 2026 19:32
Introduces support for configuring the title's font, color, and style in the scroll edge appearance of the top bar on iOS. Updates Objective-C and TypeScript interfaces and implements logic to apply these title attributes when the scroll view reaches the edge.
Deleted an unnecessary blank line in the initWithDict method for improved code cleanliness.
@Beat-YT
Copy link
Contributor Author

Beat-YT commented Feb 1, 2026

hey @markdevocht can you take a look please ?

@markdevocht markdevocht self-requested a review February 22, 2026 07:50
@markdevocht
Copy link
Contributor

@Beat-YT @space0mel - I'll start the review :)

Copy link
Contributor

@yedidyak yedidyak left a comment

Choose a reason for hiding this comment

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

Nice addition, the API design and initial render path look great! Just one issue I spotted with the dynamic update flow:

mergeOptions doesn't handle scroll edge title changes

Two related problems:

  1. TopBarAppearancePresenter's mergeOptions:withDefault: isn't updated to call setScrollEdgeTitleAttributes:, so calling Navigation.mergeOptions() at runtime to change the scroll edge title will have no effect.

  2. The existing setTitleAttributes: (line 158) always overwrites self.getScrollEdgeAppearance.titleTextAttributes with the regular title attributes. This means if only the regular title is merged at runtime, it will reset the scroll edge title back to match the regular title — undoing any scroll-edge-specific customization set during initial apply.

To fix both:

  • Add a block in mergeOptions:withDefault: to apply scroll edge title changes (similar to how borderColor/noBorder are handled there)
  • Make setTitleAttributes: stop writing to the scroll edge appearance, and let setScrollEdgeTitleAttributes: be solely responsible for it (or re-apply the scroll edge title after setTitleAttributes: during merges)

Otherwise looks great — the TS types are well-scoped and the native implementation follows existing patterns cleanly.

@Beat-YT
Copy link
Contributor Author

Beat-YT commented Feb 25, 2026

Fixed both issues:

  • setTitleAttributes no longer writes to the scroll edge appearance
  • mergeOptions:withDefault now handles scroll edge title changes, and keeps scroll edge in sync with regular title when no custom scroll edge title was configured
  • Also simplified the redundant nil check before hasValue

Apologies for the force push noise in the timeline. I was squashing commits locally and jumped the gun.

markdevocht added a commit that referenced this pull request Feb 25, 2026
Co-authored-by: Beat-YT <Beat-YT@users.noreply.github.com>
@Beat-YT
Copy link
Contributor Author

Beat-YT commented Feb 25, 2026

It appears that commit d1fc87d to master did not include the subsequent commit from this pull request, but only the first one (check #8233). Does this need to be addressed?

@markdevocht
Copy link
Contributor

markdevocht commented Feb 26, 2026

@Beat-YT please check this pr: #8239

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.

3 participants