Skip to content

fix(example): center top and bottom edge switches on iOS - #801

Merged
janicduplessis merged 1 commit into
mainfrom
floco/example-switch-align
Oct 28, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
floco/example-switch-align

Conversation

@floco-af

Copy link
Copy Markdown
Contributor

Recent React Native versions give the iOS Switch a default alignSelf: 'flex-start' (it used to be a fixed width/height). That overrides the container's alignItems: 'center', so the absolutely positioned top and bottom switches in the SafeAreaView edges example ended up on the left edge instead of centered.

This sets alignSelf: 'center' explicitly on those two switches. The left/right switches are unaffected since they set left/right and are centered on the main axis.

Checked with prettier and eslint.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
react-native-safe-area-context Ignored Ignored Preview Oct 28, 2026 1:58pm UTC

Request Review

@janicduplessis
janicduplessis merged commit a96df15 into main Oct 28, 2026
4 checks passed
@janicduplessis
janicduplessis deleted the floco/example-switch-align branch October 28, 2026 15:33
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