fix(ios): center RNNReactButtonView inside navigation bar platter#8300
Open
IsaacIsrael wants to merge 2 commits into
Open
fix(ios): center RNNReactButtonView inside navigation bar platter#8300IsaacIsrael wants to merge 2 commits into
IsaacIsrael wants to merge 2 commits into
Conversation
On iOS 26 the Liquid Glass navigation bar wraps custom-view bar button items in several internal layout containers. Without explicit size constraints the wrapper views can collapse to zero height after a pop → tab-switch → tab-switch → push cycle, making the React button invisible. - Guard all new logic behind @available(iOS 26.0, *) AND a runtime check for UIDesignRequiresCompatibility (compatibility mode disables Liquid Glass and uses the legacy view hierarchy) - Set translatesAutoresizingMaskIntoConstraints = NO - Add width/height constraints at UILayoutPriorityDefaultHigh - Update constraints in didMountComponentsWithRootTag: after sizeToFit Co-authored-by: Cursor <cursoragent@cursor.com>
On iOS 26 the internal _UITAMICAdaptorView wrapper is wider than the React button content and UIKit pins the custom view to the leading edge. Apply a one-time horizontal CGAffineTransform in layoutSubviews to center the view. Guarded by @available(iOS 26.0, *) and UIDesignRequiresCompatibility check. Co-authored-by: Cursor <cursoragent@cursor.com>
340487d to
db70f4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On iOS 26, the internal
_UITAMICAdaptorViewwrapper view (~36pt) is wider than the React button content (~24.7pt), and UIKit pins the custom view to the leading edge. This makes the button icon/text appear visually off-center within the circular Liquid Glass platter.Solution
Apply a one-time horizontal
CGAffineTransforminlayoutSubviewsto shift theRNNReactButtonViewto the center of its wrapper view.The centering is computed once (guarded by
_didCenter) to avoid repeated recalculations.Depends on: #8299
Test plan
Made with Cursor