[iOS] Add title customization to scroll edge appearance#8207
[iOS] Add title customization to scroll edge appearance#8207Beat-YT wants to merge 4 commits intowix:masterfrom
Conversation
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.
|
hey @markdevocht can you take a look please ? |
|
Hey @markdevocht 👋 Just bumping this — PR's been open for a month now and it's still cleanly mergeable. Any chance you could give it a review? Small change, 62 additions, no deletions. Would love to get it in. Thanks! |
|
@Beat-YT @space0mel - I'll start the review :) |
yedidyak
left a comment
There was a problem hiding this comment.
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:
-
TopBarAppearancePresenter'smergeOptions:withDefault:isn't updated to callsetScrollEdgeTitleAttributes:, so callingNavigation.mergeOptions()at runtime to change the scroll edge title will have no effect. -
The existing
setTitleAttributes:(line 158) always overwritesself.getScrollEdgeAppearance.titleTextAttributeswith 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 howborderColor/noBorderare handled there) - Make
setTitleAttributes:stop writing to the scroll edge appearance, and letsetScrollEdgeTitleAttributes:be solely responsible for it (or re-apply the scroll edge title aftersetTitleAttributes:during merges)
Otherwise looks great — the TS types are well-scoped and the native implementation follows existing patterns cleanly.
Add scrollEdgeAppearance title styling support (iOS)
What
This PR adds support for configuring top bar title styling specifically for
scrollEdgeAppearanceon iOS.UIKit treats
scrollEdgeAppearanceas a fullUINavigationBarAppearance,including
titleTextAttributes. Previously, React Native Navigation alwaysapplied 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
Demo
Tests
This change affects UIKit
UINavigationBarAppearancebehavior and depends onscroll-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