feat(ios): support backgroundImage layering#192
Open
V3RON wants to merge 5 commits into
Open
Conversation
Add a separate backgroundImage layer on iOS, preserve backgroundColor compatibility, and document the layering behavior.
Update iOS styling docs to show backgroundImage as the primary gradient prop while keeping backgroundColor gradient usage documented for compatibility.
Keep the compatibility note but avoid showing backgroundColor gradient usage now that backgroundImage is the preferred API.
Replace the internal ZStack background layering with ordered SwiftUI background modifiers while preserving backgroundColor behind backgroundImage.
Update the iOS gradient playground to exercise backgroundImage and add a composed background section combining backgroundColor with a translucent gradient layer.
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.
What is this?
This PR adds a first-class
backgroundImagestyle prop on iOS so gradient overlays behave like Android and like web users expect. It keeps existingbackgroundColorgradient support for backward compatibility, butbackgroundImagenow acts as the dedicated overlay layer.How does it work?
The iOS style converter now reads both
backgroundColorandbackgroundImageinto separate decoration slots. The renderer paints them in order sobackgroundColoracts as the base layer andbackgroundImagerenders on top, including semitransparent gradients.LinearGradientcomponents also populatebackgroundImage, and chart styling preserves the same layering path.Why is this useful?
backgroundColorgradient strings are still supported.